instance method append_editor

Ruby on Rails edge

Since edge

Signature

append_editor()

No documentation comment.

Source
# File actiontext/lib/generators/action_text/install/install_generator.rb, line 26
      def append_editor
        destination = Pathname(destination_root)
        editor = options[:editor]

        if (application_javascript_path = destination.join("app/javascript/application.js")).exist?
          insert_into_file application_javascript_path.to_s, %(\nimport "#{editor}"\n)
        else
          say <<~INSTRUCTIONS, :green
            You must import the #{editor} JavaScript module in your application entrypoint.
          INSTRUCTIONS
        end

        if (importmap_path = destination.join("config/importmap.rb")).exist?
          append_to_file importmap_path.to_s, %(pin "#{editor}"\n)
        end
      end

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

Defined in ActionText::Generators::InstallGenerator

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close