Class: Ng::Generators::ShowGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/ng/show/show_generator.rb

Instance Method Summary collapse

Instance Method Details

#routeObject



13
14
15
16
17
18
19
20
# File 'lib/generators/ng/show/show_generator.rb', line 13

def route
  inject_into_file 'app/assets/javascripts/ng/routes.coffee', after: "$stateProvider\n" do
    "    .state         '#{ng_singular_name}',\n"\
    "      controller:  '#{class_name}Ctrl'\n"\
    "      url:         '/#{plural_name}/:id'\n"\
    "      templateUrl: '#{plural_name}/show.html'\n\n"
  end
end

#showObject



8
9
10
11
# File 'lib/generators/ng/show/show_generator.rb', line 8

def show
  template 'show.html', "app/assets/templates/#{plural_name}/show.html"
  template 'show_ctrl.coffee', "app/assets/javascripts/ng/controllers/#{singular_name}_ctrl.coffee"
end