Class: ModelGen::EntitiesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/model_gen/entities_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#newObject



5
6
# File 'app/controllers/model_gen/entities_controller.rb', line 5

def new
end