Class: Ns::ScaffoldGenerator
- Inherits:
-
Rails::Generators::ScaffoldGenerator
- Object
- Rails::Generators::ScaffoldGenerator
- Ns::ScaffoldGenerator
- Defined in:
- lib/generators/ns/scaffold/scaffold_generator.rb
Overview
puts “====options: #Rails::Generators.options.inspect”
Instance Method Summary collapse
Instance Method Details
#dump_field_mapping ⇒ Object
20 21 22 23 24 25 |
# 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 ⇒ Object
28 29 30 31 32 33 34 35 |
# 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 |