In my project, I have this following code
scenario = Scenario.new
scenarioTranslation = ScenarioTranslation.new
params[:title].each do | index |
scenario.position = last_position + 1
scenario.analysis_id = scenarioTranslation.scenario_id
scenario.save
end
Here the params[:title] is an array and I have to loop through number of array elements and save the scenario
Currently its saving only once. Can anyone tell me how to fix this error
Thanks