Class: ModelGen::RelationsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#available_models

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
# File 'app/controllers/model_gen/relations_controller.rb', line 10

def create
  command = "rails g model_gen:define_relations #{params[:name]}"
  params[:relations].each do |index, relation|
    command = command + " #{relation[:model].downcase}:#{relation[:type].downcase}"
  end
  system command
  redirect_to new_relations_path
end

#newObject



6
7
8
# File 'app/controllers/model_gen/relations_controller.rb', line 6

def new

end