LoginSignup
0
0

More than 3 years have passed since last update.

ActionText機能追加方法

Posted at

エディターにActionText機能追加

ActionTextを使用することでエディターを使いやすくしてみます

始めにimagemagickをインストールします。
画像の大きさや文字を入力するために必要なツールです。

ターミナルで

$brew install imagemagick

インストール後、gemfileに、

gem 'image_processing', '~> 1.2

を記載。その後↓を実行

$bundle install

ActionTextをインストール

$bundle exec rails action_text:install

を実行。
ActionTextは、JavaScriptを実行しないと使えないためライブラリーのインストールをします。

$ bundle exec rails webpacker:install

最後にActionTextのテーブルが作られているので

$ rails db:migrate

を実行

ActionTextを使用して、強化したいエディターのある記事クラスに

has_rich_text :カラム名

を記載。
後は、HTML・CSSを整えれば完成。

スクリーンショット 2020-11-02 23.25.59.png
こんな感じになりました。

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