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
0
votes
3 answers

param not found: in rails4 strong parameters

Error while using rails 4 strong parameters. ActionController::ParameterMissing at /questions param not found: question I have a Question model and questions controller. The questions table has content column this is what is contained in the…
ben
  • 6,000
  • 5
  • 35
  • 42
0
votes
3 answers

Posting parent_id in Ember.js and Rails 4 causes unpermitted parameters error. Remove or ignore?

In ember.js (1.2) I am trying to POST a change to a child model but ember.js is including the parent_id in the POST. The parent_id is not a "permitted" parameter for my Rails 4 controller, however, so the POST fails with the following…
GSP
  • 3,763
  • 3
  • 32
  • 54
0
votes
2 answers

No implicit conversion of type Array to Integer with Rails 4.0.2 and Strong Parameters

I'm trying to update a nested model with a simple has_many / belongs_to association I've setup parameters in the controller with params.require(:survey).permit(:name, :questions[[:id, :content]]) but I get the No implicit conversion of type Array…
MikeW
  • 4,749
  • 9
  • 42
  • 83
0
votes
1 answer

rails 4 use strong_parameter or use protected_attribute with attr_accessible

I am converting my application to rails 4 from rails 3 in rails 4 attr_accessible is not allowed for that one need to add strong parameter but some where I read that one can use pretected_attribute gem so that you can not change the attr_accessible…
urjit on rails
  • 1,763
  • 4
  • 19
  • 36
0
votes
1 answer

Rails 4 Strong Parameters Unknown Key

I've followed the Railscast for migrating an application to Rails 4 and the transition to Strong Parameters. http://railscasts.com/episodes/415-upgrading-to-rails-4 I have my Create/New methods working fine. But, I'm having problems when I try to…
Scott S.
  • 749
  • 1
  • 7
  • 26
0
votes
1 answer

User id is not saving in the Events table. This is a rails project using postgresql database

I used devise to create my users and I am trying to get the user_id to save in the events table when I create an event, I keep getting the error "cant find user without id". Not sure what the problem is any pointers would be greatly…
Steve_D
  • 545
  • 2
  • 11
  • 20
0
votes
1 answer

Rails Strong parameters Nested ressources Child and Outside

I have nested resources like that : resources :cards do resources :teammates resources :formata, only: [:index, :show] end I use formata#show to render an alternative card#show Cards has_many teammates QUESTION : I would like to display…
0
votes
1 answer

Strong parameters and Nested Routes - Rails 4.0

I have no idea how this works in rails but I set up routes like this: resources :users do resources :api_keys end (User has_many: api_keys, api_key belongs_to: user) So I then (since I only care about API Keys), created the following…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
0
votes
2 answers

Rails controller#update giving incorrect type for params

I want to update a model using controller#update. I want to do this via AJAX and without having a hidden form or any DOM elements to keep in sync with my JS data. How can I submit data to a controller#update via jQuery ajax? My JS: $.ajax({ type:…
0
votes
2 answers

Rails 4 Strong Parameters opposite permit all attributes

I am using rails 4 with strong parameters and trying to figure out how to set the strong parameters to not allow any attribute with the parameter. I read this Rails 4 Strong parameters : permit all attributes? And would like to do the opposite of…
Daniel
  • 2,950
  • 2
  • 25
  • 45
0
votes
1 answer

Strong Params won't save nested has_many

I'm using Rails 4, and with it Strong Params. For some reason I can't save my nested parameters. I've looked at how to do it and even might've gotten it working in a different Rails app before. I know to permit draft_players_attributes and list…
0
votes
1 answer

has_many Nested Attributes in Rails 4 (save multiple objects with strong parameters)

I have a user who has_many services: class User < ActiveRecord::Base has_many :services accepts_nested_attributes_for :services, :reject_if => lambda { |s| s[:name].blank? }, :allow_destroy => true end Here is my controller actions (devise) def…
benoitr
  • 6,025
  • 7
  • 42
  • 67
0
votes
1 answer

rails 4 strong params error: param not found

Im trying to accomplish some functionality in the update method of my model. However, I am getting the following errors which seem to be due to the strong parameter convention introduced in rails 4. Upload.rb (Model) Update method def…
banditKing
  • 9,405
  • 28
  • 100
  • 157
0
votes
1 answer

Rails 4 use of non-model attributes in params resulting in undefined method `merge' for nil:NilClass

I have a search form on an index page for my Properties model which is using both Ransack and Geocoder to search the Properties model fields as well as narrow the results down based on distance from an address input by the user in the search form. …
0
votes
1 answer

How to use strong parameters in Rails 4?

I am trying to upgrade my app from Rails 3 to Rails 4 and I can't seem to get the syntax right in line 12: class ProjectsController < ApplicationController before_filter :find_project ... private def find_project @project =…
Tintin81
  • 9,821
  • 20
  • 85
  • 178