我的应用程序中有两个模型:list.rb并且contacts.rb,它们有has_and_belongs_to_many关系。我有以下方法contacts_controller.rb:
def import
Contact.import(params[:file])
redirect_to contacts_path, notice: "Contacts were imported."
end
List在操作中创建一个之后,我正在调用他的方法list#create。我怎样才能进入上面set/input的list_id这个导入方法,其中记录是通过csv文件创建的?
谢谢!