Module: Incline::Extensions::ErbScaffoldGenerator

Defined in:
lib/incline/extensions/erb_scaffold_generator.rb

Overview

Adds one more view to the standard ERB views.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Override the “available_views” method to return one more view.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/incline/extensions/erb_scaffold_generator.rb', line 10

def self.included(base)
  base.class_eval do
    # point to our templates.
    source_root File.expand_path('../../../templates/erb/scaffold', __FILE__)

    protected

    undef available_views

    # the _list view can be included as a partial for parent items.
    def available_views
      %w(index new edit show _list _form)
    end

  end
end