I've tried to use IR in rails4 app, but my code
class WorkspacesController < InheritedResources::Base
private
def permitted_params
params.permit(:workspace => [:name, :owner_id])
end
end
raises ActiveModel::ForbiddenAttributesError exception.
the same problem with following code
def permitted_params
params.permit(:name, :owner_id)
end
Whats wrong with this code?
PS: i've tried following protip http://blog.josemarluedke.com/posts/inherited-resources-with-rails-4-and-strong-parameters but with 4.0rc1 it doesn't work :(
I had the same problem.
You need to put permitted_params method as public method in your controller class. It's NOT a private method.
I hope this help.
I have meet this problem too, but seem not same as yours, just put how I resolve this in case some meet same problem with mine
replace Gemfile with this
gem 'inherited_resources', github: 'josevalim/inherited_resources'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With