Questions tagged [strong-parameters]

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.

956 questions
-1
votes
1 answer

Rails Strong parameters ActiveModel::ForbiddenAttributesError

Hi I know that Rails 4 is using strong parameters and i need to allow them in controller which is what i do but i still get this error. My request looks like…
minohimself
  • 496
  • 3
  • 9
-1
votes
1 answer

Has_many :through Rails 4 Instance variable not working

I have problem with strong params in Ruby on Rails 4. I have 3 models Entity, user, user_entity. User_entity ties together entity and user with has_many :through association. Here is code that works perfectly! /views/user_entity/show.html.erb

-1
votes
2 answers

Unpermitted Parameters Error for Whitlisted Attributes

I'm working on a sort of web based game using rails. My goal is to set up a form that allows a user to create a fort on the user/show page via a user update form. I have been using nested attributes and associations to try to solve the problem but I…
-1
votes
1 answer

Rails 4: Link tag that creates a record doesn't work with strong params

I'd like to create a new post simply by clicking a link. When I create this button, I get an error (below): HTML: <%= link_to 'Create That Post', { controller: 'posts', action: 'create', user_id: '123', title: 'Test Create a Post' …
Don P
  • 60,113
  • 114
  • 300
  • 432
-1
votes
2 answers

Testing strong parameters

I want to test my strong parameters in rails controllers. The best way I have found so far is the one described here: http://pivotallabs.com/rails-4-testing-strong-parameters/ Unfortunately this leads to "blacklist" testing: I can only test wether…
Jag Älskar
  • 317
  • 3
  • 11
-1
votes
1 answer

rails nested form not permitting a parameter that it should

I can't figure out why this nested form is not working. Skill belongs_to Profile and profile has_many skills. For some reason, the sever logs show the following error when the form is submitted: Parameters: {"utf8"=>"✓",…
-1
votes
2 answers

ActiveModel::ForbiddenAttributesError in-spite of params.require(:model).permit

I have a model for which I am permitting all updates for an admin user. This is the relevant code in the controller and model : private: class ModelsController < ApplicationController def model_params …
-1
votes
1 answer

Nested Forms with Strong Parameters; object_attribute method not available?

This example is kind of cliche. I am following the railscasts episode #196 (http://railscasts.com/episodes/196-nested-model-form-revised?autoplay=true) for double nested forms. The error I get is that my accepts_nested_attributes_for command is not…
miler350
  • 1,411
  • 11
  • 15
-2
votes
1 answer

Strong Params in Rails model

I have a model Peoples::Friend and my friend.rb is : attr_accessible :name, :age I removed this line because of mass assignment vulnerability. I have this controller peoples_controller.rb friend = Peoples::Friend.update_attributes(:name => "test",…
Hellboy
  • 1,199
  • 2
  • 15
  • 33
-3
votes
2 answers

Warning: mysqli_query() expects at least 2 parameters,1 given in [...]

Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\Quman\registar.php on line 11 Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Quman\registar.php on line 12 Warning:…
Hex
  • 11
  • 1
  • 1
  • 3
-3
votes
1 answer

I am getting this error message after submitting a test post: param is missing or the value is empty: content?

I am trying to submit a test post through my form, and I am getting this error: param is missing or the value is empty: content. I am requiring "content" and permitting a "title". Both fields were filled out when submitting the post or "thought"…
1 2 3
63
64