Class: ModelGen::EntitiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ModelGen::EntitiesController
- Defined in:
- app/controllers/model_gen/entities_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/controllers/model_gen/entities_controller.rb', line 8 def create command = "rails g model #{params[:name].downcase}" params[:fields].each do |index, field| command = command + " #{field[:name].downcase}:#{field[:type].downcase}" end system command redirect_to new_entity_path end |
#new ⇒ Object
5 6 |
# File 'app/controllers/model_gen/entities_controller.rb', line 5 def new end |