Strong Parameters requires whitelisting of Action Controller parameters by default. In Ruby on Rails this means the developer will have to make a choice about which Active Model attributes are eligible for mass assignment. Strong parameters have been included in Rails 4 by default.
Questions tagged [strong-parameters]
956 questions
0
votes
2 answers
Rails 4.0 & Devise - Strong Parameters error
Newbie to rails here, so bear with me.
New app on Rails 4 with ruby 2.0, I installed Devise and followed the instructions(default root, etc). Devise readme on github says it should be compatible with rails4 but
db:migrate failed unless I commented…
user2360003
0
votes
1 answer
Rails submit button for boolean attribbute
I wanted to know how to go about have a submit button that will change a boolean attribute, instead of using radio buttons.
As a example if I display a list of 'published' and unpublished' article posts on the Post#index page and I wanted a button…

Wasabi Developer
- 3,523
- 6
- 36
- 60
0
votes
1 answer
Select2 + Rails 4 / Strong Parameters
BACKGROUND: Posts have many Communities. On my new post form, I have a multiple select box for selecting communities using Select2.
When selecting a community without Select2, I get these params, and everything works…

neon
- 2,811
- 6
- 30
- 44
0
votes
1 answer
ActiveModel::ForbiddenAttributes with Rails engine
I am using a Rails engine (Social Stream), that uses the strong_parameters gem in a rails 3 app. When trying to update I get errors but cannot identify where the problem is.
I am using a modal ajax form on an update action, with update_attributes. I…

port5432
- 5,889
- 10
- 60
- 97
0
votes
1 answer
Rails 3.2.13 and strong_parameters exceptions
I'm playing around with Rails 3.2.13 and the strong_parameters gem. I wanted to know if I should be getting a raised exception from ActiveModel::ForbiddenAttributes when I'm testing in development?
My Post model has a :title and :content but if I…

Wasabi Developer
- 3,523
- 6
- 36
- 60
0
votes
1 answer
Devise conflicting with Strong Parameters when doing an api only app
I wanted to create an api only app with the new gem: strong_parameters. My app uses devise token authentication to authenticate the user. Everything was working great until I realized the user can never be authenticated. I've followed all the guides…

meatherly
- 1,741
- 2
- 13
- 16
0
votes
1 answer
Declarative Authorization: restrict model actions on specific attributes
I'm quite new to rails and I'm trying to setup an authorization system that allows me to control which attributes of a model can be modified by a user.
I use declarative_authorization for a role based authorization. This already provides me quite a…

Kalumet
- 81
- 7
0
votes
2 answers
allow set_locale with strong_parameters gem & devise
I'm using strong parameters gem on small project with devise
I have added User.rb a locale column. This is my controllers/users/registrations_controller.rb file:
class Users::RegistrationsController < Devise::RegistrationsController
def…

hyperrjas
- 10,666
- 25
- 99
- 198
0
votes
2 answers
Mongoid and mass assignment
I have the following mogoid document definition/class:
class Exercise
include Mongoid::Document
field :name, :type => String
field :description, :type => String
belongs_to :group
validates_presence_of :name, :description
end
I then have…

dagda1
- 26,856
- 59
- 237
- 450
-1
votes
2 answers
Strong Parameters: ActiveModel::ForbiddenAttributesError
Lets say I have a PostsController and I have a Post model and Comment model. I'm allowing comments to be made on a Post, so on my posts/show I put the following
# routes.rb
resource :post do
member do
post :add_comment
end
end
#…

Berimbolo
- 293
- 2
- 12
-1
votes
2 answers
undefined local variable or method `article_params' for
articles_controller.rb
class ArticlesController < ApplicationController
def index
@articles = Article.all
end
def show
@article = Article.find(params[:id])
end
def new
end
def create
@article =…

vishal jat
- 121
- 1
- 10
-1
votes
1 answer
Ruby on Rails 5: Can't Save Record, Unpermitted Parameter for Has Many Through Record
Ruby on Rails 5, Simple Form
Product has many Specifications through ProductSpecs
in Product#Edit, I want to add new Specifications.
if Specifications.save successful, rerender Product. It rerenders products and flashes "success", but the new…

yaycake
- 3
- 3
-1
votes
1 answer
Rails 5 how to retrieve strong parameters list (formerly accessible_attributes) from Model?
I implemented the method described in #396 Importing CSV and Excel
which worked fine in Rails 4.
Now I want to do the same in a Rails 5 application. But, it looks like accessible_attributes is deprecated, as I get an Undefined method…

user1185081
- 1,898
- 2
- 21
- 46
-1
votes
1 answer
undefined method `permit' for # ruby on rails
I read many links specially on stackoverflow but could not find the solution as there was some difference . so I want to make my point clear as explained below:
I have an ajax call pointing to my controller and it has only one parameter…

Mani
- 2,391
- 5
- 37
- 81
-1
votes
2 answers
How can I implement strong parameters in rails 4?
My User model is as follows (user.rb)
class User < ActiveRecord::Base
validates :password, presence: true, length: { minimum: 6 }
validates :password_confirmation, presence: true
has_secure_password
validates(:name, presence: true, length:…

pintua
- 63
- 5