-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Attr accessible in rails 4 #1368
Comments
I got this error too. devmug are you solved the problem? |
UPD. Solved, in Model, u must place the paperclip validation after all others validations |
@AndreyPristupa we'd love to have more info on this. By 'others validation', what are the rest of validations you have in there? Also, I assume you don't need |
validates :name, :start_at, :end_at, :description, presence: true has_attached_file :image, :styles => { :medium => '300x300>', :thumb => '100x100>' }, :default_url => '/images/:style/missing.png' Work's fine. But: has_attached_file :image, :styles => { :medium => '300x300>', :thumb => '100x100>' }, :default_url => '/images/:style/missing.png' validates :name, :start_at, :end_at, :description, presence: true doesn't work, trow: undefined method 'flush_errors' |
Hi @AndreyPristupa and @devmug ! Is this still an issue for you in Paperclip; I know this issue is from approximately 2 years ago. If it is still an issue, can you please provide the code that's causing you the error? Thanks! |
Given there's no activity around this issue any more, I hope things are working well for you now. I’ll close the issue, happy to continue further discussion if we can find a fix for it. Thanks for your input! |
Quick Start
In your model:
class User < ActiveRecord::Base
attr_accessible :avatar
Could you please put a note for rails 4 users not to add attr accessible .. causes a
undefined method `flush_errors' for #<ActionDispatch::Http::UploadedFile
and it took me a good 2 hours to work out what was happening.
Thanks
The text was updated successfully, but these errors were encountered: