attr-accessible Questions

3

Solved

I want to create large number of attributes which can be done with ease if constructed with method call like this, attr_accessor :attr_list def attr_list [:x1, :y1, :x2, :y2] end This is ...
Preparative asked 15/5, 2013 at 10:49

2

Solved

I have just been doing a bit of reading on attr_accessor, attr_accessible and strong parameters at a few different locations: Difference between attr_accessor and attr_accessible How is attr_acces...
Aeneus asked 11/6, 2015 at 15:17

5

Solved

With the recent upgrade to Rails 4, updating attributes using code resembling the below does not work, I get a ActiveModel::ForbiddenAttributes error: @user.update_attributes(params[:user], :as =&...

3

Solved

After reading about attr_accessible in the Rails 3.1 API, I see that there is an as :admin option in there. I would like to know two things. If the user has an admin flag, how do does my controll...

2

Solved

deprecated_mass_assignment_security.rb:17:in `attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or ...

4

Solved

I'm using the release candidate of Devise 3 so that I can use it with Rails 4. In Rails 3.2 I used to be able to add a custom field to my User model by simply adding that field to the registration/...

1

Solved

This happened when I added an attr_accessible to my Relationship model. class Relationship < ActiveRecord::Base attr_accessible :followed_id end Without using Devise or a protected_attribut...

1

Solved

When I want to test if attribute is / is not accessible with RSpec I'm doing it like this class Foo attr_accesible :something_else end describe Foo do it('author should not be accessible') {la...
Bicentenary asked 2/8, 2012 at 9:55

2

Solved

I have a Rails app with a user model that contains an admin attribute. It's locked down using attr_accessible. My model looks like this: attr_accessible :name, :email, :other_email, :plant_id, :pa...
Thermosiphon asked 15/3, 2012 at 19:21

5

Solved

When I use the attr_accessible to specify which fields from my Model I will expose, is it true for script/console as well? I mean something that I didn't specify as attr_accessible won't be accessi...
Octamerous asked 24/11, 2009 at 13:17

3

Solved

Is there a way to have rails raise an error if an attempt is made to mass-assign attributes that aren't allowed by attr_accessible? This would be handy in development to remind me why my shiny new...
Baccate asked 13/8, 2010 at 10:22

2

Solved

I have a Rails app that is a blogging platform, allowing for multiple contributing authors. My User model has a :writer boolean attribute for assigning writing permissions. However, :writer is NOT ...
Lateshalatest asked 16/5, 2011 at 11:32

4

Solved

What happens in the background with the following code? class User < ActiveRecord::Base attr_accessor :name attr_accessible :name end Hint: When instantiating the class, will it be persis...
Inglis asked 15/1, 2011 at 16:45
1

© 2022 - 2024 — McMap. All rights reserved.