class Ns::ScaffoldGenerator

puts “====options: #{Rails::Generators.options.inspect}”

Public Instance Methods

dump_field_mapping() click to toggle source
# File lib/generators/ns/scaffold/scaffold_generator.rb, line 20
def dump_field_mapping
  the_model = Object.const_get(class_name)
  mapping_file = the_model.dump_mapping
  say("   Generated field mapping for model: #{name}...", :green)
  say("   You can configure it in #{mapping_file}.", :green)
end
reroute() click to toggle source
# File lib/generators/ns/scaffold/scaffold_generator.rb, line 28
  def reroute
    #TODO MOVE dev interface TO this gem controller
    gsub_file('config/routes.rb', /^\s*resources :#{plural_name}$/) do
      <<-Doc 
  resources :#{plural_name}, :except=>[:edit] 
      Doc
    end
  end