I have two models in my app: list.rb
and contacts.rb
, they have a has_and_belongs_to_many
relationship.
I have the following method in my contacts_controller.rb
:
def import
Contact.import(params[:file])
redirect_to contacts_path, notice: "Contacts were imported."
end
I am calling his method after creating a List
in the list#create
action. how can I set/input
the list_id
into this import method above, where the records are created through a csv
file?
Thank you!