class Ng::Generators::IndexGenerator

Public Instance Methods

index() click to toggle source
# File lib/generators/ng/index/index_generator.rb, line 8
def index
  template 'index.html.erb', "app/assets/templates/#{plural_name}/index.html.erb"
  template 'index_ctrl.coffee', "app/assets/javascripts/ng/controllers/#{plural_name}_ctrl.coffee"
end
route() click to toggle source
# File lib/generators/ng/index/index_generator.rb, line 17
def route
  inject_ng_route do
    "    .state         '#{ng_plural_name}',\n"\
    "      controller:  '#{plural_name.camelize}Ctrl'\n"\
    "      url:         '/#{plural_name}'\n"\
    "      templateUrl: '#{plural_name}/index.html'\n\n"
  end
end
spec() click to toggle source
# File lib/generators/ng/index/index_generator.rb, line 13
def spec
  template 'spec.rb.erb', "spec/features/#{singular_name}_index_html_spec.rb"
end

Protected Instance Methods

belongs_to_class_names() click to toggle source
# File lib/generators/ng/index/index_generator.rb, line 28
def belongs_to_class_names
  all_belongs_to.map(&:class_name)
end