2016年12月1日 星期四

html: { multipart: true }

rails tutorial裡面再講圖片上傳的時候說form_for一定要加html: { multipart: true }這個參數
不過rails4開始form_for會自動加,form_tag才需要手動家的樣子

http://guides.rubyonrails.org/form_helpers.html#uploading-files

 If you use form_for, this is done automatically. If you use form_tag, you must set it yourself

沒有留言:

張貼留言