activerecord - rails - saving data to another controller -


I am trying to get data on an administrator and then save it to another controller / model

I wrote the following API:

  class ExportController & lt; ApplicationController def Search @assignment = Assignment.find_by_id (params [: assignment_id]) @ assignment. Candidates.new (params [: candidate_ids]) @ assignment.candidates.create  

is a habtm < / P>

assignment_id [], candidate_id []

This is the error that I get -

  undefined method `stringify_keys!  

thanks

Edit

P> If I change it

I have not found any errors but It creates a new candidate and then adds it to the intersection table.

  class ExportController & Lt; ApplicationController def search @assignment = Assignment.find_by_id (params [: assignment_id]) @signment. Cdidate_ids = params [: candidate_ids] @ assignment.save  

Comments