method
create_actiontext_files
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: InstallGenerator
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
create_actiontext_files()
public
Hide source
# File actiontext/lib/generators/action_text/install/install_generator.rb, line 36 def create_actiontext_files destination = Pathname(destination_root) template "actiontext.css", "app/assets/stylesheets/actiontext.css" unless destination.join("app/assets/application.css").exist? if (stylesheets = Dir.glob "#{destination_root}/app/assets/stylesheets/application.*.{scss,css}").length > 0 insert_into_file stylesheets.first.to_s, %(@import 'actiontext.css';) else say <<~INSTRUCTIONS, :green To use the Trix editor, you must require 'app/assets/stylesheets/actiontext.css' in your base stylesheet. INSTRUCTIONS end end gem_root = "#{__dir__}/../../../.." copy_file "#{gem_root}/app/views/active_storage/blobs/_blob.html.erb", "app/views/active_storage/blobs/_blob.html.erb" copy_file "#{gem_root}/app/views/layouts/action_text/contents/_content.html.erb", "app/views/layouts/action_text/contents/_content.html.erb" end