Module: Stationed::Generators::Plugins::Draper

Included in:
AppGenerator
Defined in:
lib/stationed/generators/plugins/draper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
# File 'lib/stationed/generators/plugins/draper.rb', line 5

def self.prepended(base)
  base.class_option :draper,
    type: :boolean,
    default: true,
    desc: 'Include and configure draper for view decorators'
end

Instance Method Details

#finish_templateObject



12
13
14
15
16
17
18
# File 'lib/stationed/generators/plugins/draper.rb', line 12

def finish_template
  return super unless options[:draper]
  gem 'draper'
  copy_file 'application_decorator.rb', 'app/decorators/application_decorator.rb'
  copy_file 'paginating_decorator.rb', 'app/decorators/paginating_decorator.rb'
  super
end