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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -