instance method create_actiontext_files

Ruby on Rails 7.1.6

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

create_actiontext_files()

No documentation comment.

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

Defined in actiontext/lib/generators/action_text/install/install_generator.rb line 36 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionText::Generators::InstallGenerator

Type at least 2 characters to search.

↑↓ navigate · open · esc close