Class: BasePresenter::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#generate_installObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/base_presenter/install/install_generator.rb', line 6

def generate_install
  copy_file "application_presenter.rb", "app/presenters/application_presenter.rb"
  create_file "app/presenters/#{model_name.underscore}_presenter.rb", "class \#{model_name.classify}Presenter < ApplicationPresenter\n  presents :\#{model_name.underscore.split(\"/\").last}\n\n  # delegete :name\nend\n"
end