Attr Accessor in Rails 4

56 views
Skip to first unread message

Jan Yo

unread,
Sep 8, 2014, 4:07:56 PM9/8/14
to rubyonra...@googlegroups.com
Is attr_accessor no longer used in RAils 4 since there are strong
parameters? If strong parameters are disabled, then are attr_accessors
necessary?

--
Posted via http://www.ruby-forum.com/.

Jan Yo

unread,
Sep 8, 2014, 4:08:48 PM9/8/14
to rubyonra...@googlegroups.com
Are attr_accessors no longer needed in Rails 4 since there are strong
params?
If strong params are disabled, then are attr_accessors necessary?

Matt Jones

unread,
Sep 9, 2014, 9:49:23 AM9/9/14
to rubyonra...@googlegroups.com


On Monday, 8 September 2014 16:08:48 UTC-4, Ruby-Forum.com User wrote:
Are attr_accessors no longer needed in Rails 4 since there are strong
params?
If strong params are disabled, then are attr_accessors necessary?


attr_accessor is unrelated to strong parameters - it's a core Ruby function: http://www.ruby-doc.org/core-2.1.2/Module.html#method-i-attr_accessor

You may be referring to attr_accessible, which has been removed to the protected_attributes gem in Rails 4: https://github.com/rails/protected_attributes

--Matt Jones
 
Reply all
Reply to author
Forward
0 new messages