8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/rails/generators/devape_page/devape_page_generator.rb', line 8
def setup
inject_into_class "app/controllers/pages_controller.rb", PagesController do
"
def #{action_name_u}
@title = '#{action_name_u}'
@page_part = PagePart.new
@page_part_title = '#{action_name_u}'
@page_parts = PagePart.where(:page_title=>'#{action_name_u}').order('sort_order')
end
"
end
template "page.html.erb", "app/views/pages/#{action_name_u}.html.erb"
route("match '/#{action_name_u}' => 'pages##{action_name_u}'")
end
|