Class: Pageflow::Generators::AssetsGenerator Private

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow/assets/assets_generator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#create_assetsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/generators/pageflow/assets/assets_generator.rb', line 11

def create_assets
  template 'editor.js', 'app/assets/javascripts/pageflow/editor.js'
  template 'editor.scss', 'app/assets/stylesheets/pageflow/editor.scss'

  template 'application.js', 'app/assets/javascripts/pageflow/application.js'
  template 'application.scss', 'app/assets/stylesheets/pageflow/application.scss'

  template 'components.js', 'app/assets/javascripts/components.js'

  append_to_file 'app/assets/javascripts/active_admin.js' do
    "//= require pageflow/admin\n"
  end

  append_to_file 'app/assets/stylesheets/active_admin.scss' do
    "@import \"pageflow/admin\";\n"
  end
end

#initialize_on_precompileObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
32
33
34
35
# File 'lib/generators/pageflow/assets/assets_generator.rb', line 29

def initialize_on_precompile
  inject_into_file 'config/application.rb',
                   after: "class Application < Rails::Application\n" do
    "    # required for i18n-js gem\n    " \
      "config.assets.initialize_on_precompile = true\n\n"
  end
end