Class: Blocky::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/blocky/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#install_blocky_content_helperObject

Install the content block helper into the main app’s ApplicationHelper.



11
12
13
14
15
# File 'lib/generators/blocky/install_generator.rb', line 11

def install_blocky_content_helper
  insert_into_file(File.join("app", "helpers", "application_helper.rb"), after: "module ApplicationHelper\n") do
    "  include BlockyHelper\n"
  end
end

#install_migrationsObject

Install the database migrations required for Blocky’s content blocks



6
7
8
# File 'lib/generators/blocky/install_generator.rb', line 6

def install_migrations
  rake "blocky:install:migrations"
end