-1

I implemented the method described in #396 Importing CSV and Excel which worked fine in Rails 4.

Now I want to do the same in a Rails 5 application. But, it looks like accessible_attributes is deprecated, as I get an Undefined method accessible_attributes for ... when trying to use it.

How to smartly retrieve the list of strong parameters now ?

Thanks.

user1185081
  • 1,898
  • 2
  • 21
  • 46

1 Answers1

1

You gotta use the controller for whitelisting.

def create
  @post = Post.new(post_params)
  ....
end

private

  post_params
    params.require(:post).permit(:body, :title)
  end
Sean Magyar
  • 2,360
  • 1
  • 25
  • 57