search for: massassignmentsecurity

Displaying 6 results from an estimated 6 matches for "massassignmentsecurity".

2010 Dec 16
0
MassAssignmentSecurity for multiple contexts
I need to add some mass assignment protection (ala ActiveModel::MassAssignmentSecurity) but I can''t find how to do it contextually. For example, in one controller action I want to to whitelist attributes x, y and z and in another I want to whitelist attribs y and z. How can I do that? The attr_accessible function has a class-wide scope, whether in a model or in a controller....
2012 Apr 13
0
Scoped attr_accessible not working?
Please refer to the ActiveModel MassAssignmentSecurity api<http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html>for this. I''m on Rails3.2.3/Ruby1.9.3 and trying to use that technique in the controller as described. It is supposed to dynamically restrict the attributes that can be mass assigned. Howev...
2013 Jan 12
1
showing posts in blog
When I make a new post in my blog, it returns this when I try to view my current posts: --------------------------------------------------------------------------- ActiveModel::MassAssignmentSecurity::Error in PostsController#create Can''t mass-assign protected attributes: text Rails.root: C:/Users/Josh Koloff/Desktop/Programming Stuff/Rails Stuff/blog Application Trace | Framework Trace | Full Trace app/controllers/posts_controller.rb:43:in `new'' app/controllers/posts_contr...
2011 Feb 03
5
Ignore attr_accessible in seed file
Is there a way to tell Rails to ignore attr_accessible when seeding the database and to allow mass assignment with create or new? I know how to skip validations but do not find anything on mass assignment... -- 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
2011 Apr 27
2
Can not create model instance via params on specific model but can on others....
Anyone have an idea on this? Got a weird situation where on a specific model I can not create an instance using params, yet it works fine on other models. The model which does not work is a stock model, there is no logic in it. Ruby 1.8.7/Rails 3.0.5. Does not work: (rdb:1) PaymentTransaction.create(:purchase_id => 3) #<PaymentTransaction id: 2, purchase_id: nil, action: nil, amount: nil,
2012 Apr 27
1
Can't mass-assign protected attributes even if I use attr_accessible
...9;m working on a Rails 3.2.2 application which has JSON APIs and I use a CLI client for inserting some data. It works fine except for the Author model. When I try to create a new post (Post belongs_to :author and Author has_many :posts) I get the following error : <h1> ActiveModel::MassAssignmentSecurity::Error in PostsController#create </h1> <pre>Can''t mass-assign protected attributes: name</pre> I did lots of searches on the topic but I found no working solution :-( I use attr_accessible to avoid MassAssignent errors and it works for all others models but not...