aekwolf
2012-Apr-02 03:33 UTC
New Rails User stuck on tutorial => Updating Posts/Mass Assignment
Hey guys, I''ve just started with Rails. I''m going through the getting started tutorial, and I''m running into this error: ActiveModel::MassAssignmentSecurity::Error in PostsController#update I know it has to do with the new update and the whitelist attributes, but I don''t have the first idea how to fix it. Any help would be extremely appreciated! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Tom Meinlschmidt
2012-Apr-02 15:57 UTC
Re: New Rails User stuck on tutorial => Updating Posts/Mass Assignment
add attr_accessible :my_attribute_name..... to your model.rb file tom On Apr 2, 2012, at 5:33 , aekwolf wrote:> Hey guys, I''ve just started with Rails. I''m going through the getting > started tutorial, and I''m running into this error: > ActiveModel::MassAssignmentSecurity::Error in PostsController#update > I know it has to do with the new update and the whitelist attributes, > but I don''t have the first idea how to fix it. > > Any help would be extremely appreciated! > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
aekwolf
2012-Apr-02 20:48 UTC
Re: New Rails User stuck on tutorial => Updating Posts/Mass Assignment
Thank you!! On Apr 2, 11:57 am, Tom Meinlschmidt <to...-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org> wrote:> add > > attr_accessible :my_attribute_name..... > > to your model.rb file > > tom > > On Apr 2, 2012, at 5:33 , aekwolf wrote: > > > Hey guys, I''ve just started with Rails. I''m going through the getting > > started tutorial, and I''m running into this error: > > ActiveModel::MassAssignmentSecurity::Error in PostsController#update > > I know it has to do with the new update and the whitelist attributes, > > but I don''t have the first idea how to fix it. > > > Any help would be extremely appreciated! > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > ==============================================================================> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > ==============================================================================-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
YogiZoli
2012-Apr-03 16:05 UTC
Re: New Rails User stuck on tutorial => Updating Posts/Mass Assignment
Hi, yes, I had the same problem yesterday, and I''m also going through a tutorial - maybe the same one? Solved with 2 steps: added attr_accessible as mentioned earlier message. Also I had to change the RSpec tests from before @user = User.new(name:"Example", email:"example-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org").tap do |u| u.password = "foobar" u.password_confirmation = "foobar" end end isnted of before @user = User.new(name:"Example", email:"example-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org", password = "foobar", password_confirmation = "foobar") before and npw MassAssignment erros has gone. On Apr 2, 10:48 pm, aekwolf <aekw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thank you!!> > On Apr 2, 11:57 am, Tom Meinlschmidt <to...-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org> wrote: > > > > > > > > > add > > > attr_accessible :my_attribute_name..... > > > to your model.rb file > > > tom > > > On Apr 2, 2012, at 5:33 , aekwolf wrote: > > > > Hey guys, I''ve just started with Rails. I''m going through the getting > > > started tutorial, and I''m running into this error: > > > ActiveModel::MassAssignmentSecurity::Error in PostsController#update > > > I know it has to do with the new update and the whitelist attributes, > > > but I don''t have the first idea how to fix it. > > > > Any help would be extremely appreciated! > > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > =========================================================================== ===> > Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > >www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > > =========================================================================== ===-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.