Module: Stationed::Generators::Plugins::Flashes

Included in:
AppGenerator
Defined in:
lib/stationed/generators/plugins/flashes.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/flashes.rb', line 5

def self.prepended(base)
  base.class_option :flashes,
    type: :boolean,
    default: true,
    desc: 'Include generic flashes partial'
end

Instance Method Details

#finish_templateObject



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

def finish_template
  return super unless options[:flashes] && options[:layout]
  copy_file 'flashes.html.haml', 'app/views/application/_flashes.html.haml'
  super
end