0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Rails6] cocoonのインストール方法

Posted at

はじめに

railsを最近触り始めたのですが、cocoonに関する日本語の情報がほぼrails5用だったので、rails6にcocoonをインストールする方法を紹介します。cocoonについて説明はしません。多分、Rails6でjQueryの導入方法を参考にしてjqueryをいれておく必要があると思います。

インストール方法

ありがたいPRがあるので、それを活用しましょう。

gemfile
gem 'cocoon'
$ bundle install
$ yarn add github:nathanvda/cocoon#c24ba53
/javascript/packs/application.js
import 'cocoon';

参考

stackoverflow: How to use cocoon gem in Rails 6

おわりに

早くマージされるといいですね。
rails5とrails6のjs周りの違いは初心者殺しですよね。
railsのjsまわりの挙動がブラックボックスすぎてなんか知らんけど動くっていうかなり気持ち悪い状態で勉強を進めないといけなくて、ちゃんと理解しながら学びたい私にとってかなり苦痛ですよね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?