ruby on rails - permitted_params - rails4 and inherited_resources -
i've tried use ir in rails4 app, code
class workspacescontroller < inheritedresources::base private def permitted_params params.permit(:workspace => [:name, :owner_id]) end end
raises activemodel::forbiddenattributeserror exception.
the same problem following code
def permitted_params params.permit(:name, :owner_id) end
whats wrong code?
ps: i've tried following protip http://blog.josemarluedke.com/posts/inherited-resources-with-rails-4-and-strong-parameters 4.0rc1 doesn't work :(
i had same problem.
you need put permitted_params method public method in controller class. it's not private method.
i hope help.
Comments
Post a Comment