Class: Supertag::Generators::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/supertag/views_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_viewsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/supertag/views_generator.rb', line 7

def generate_views
  copy_file "views/hashtags_controller.rb", "app/controllers/hashtags_controller.rb"
  copy_file "views/usertags_controller.rb", "app/controllers/usertags_controller.rb"
  copy_file "views/moneytags_controller.rb", "app/controllers/moneytags_controller.rb"
  copy_file "views/tags_helper.rb", "app/helpers/tags_helper.rb"
  copy_file "views/hashtags_index.html.erb", "app/views/hashtags/index.html.erb"
  copy_file "views/hashtags_show.html.erb", "app/views/hashtags/show.html.erb"
  copy_file "views/usertags_index.html.erb", "app/views/usertags/index.html.erb"
  copy_file "views/usertags_show.html.erb", "app/views/usertags/show.html.erb"
  copy_file "views/moneytags_index.html.erb", "app/views/moneytags/index.html.erb"
  copy_file "views/moneytags_show.html.erb", "app/views/moneytags/show.html.erb"

  route 'get "hashtags",            to: "hashtags#index",     as: :hashtags'
  route 'get "hashtags/:hashtag",   to: "hashtags#show",      as: :hashtag'
  route 'get "usertags",            to: "usertags#index",     as: :usertags'
  route 'get "usertags/:usertag",   to: "usertags#show",      as: :usertag'
  route 'get "moneytags",            to: "moneytags#index",     as: :moneytags'
  route 'get "moneytags/:moneytag",   to: "moneytags#show",      as: :moneytag'
end