Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Adrian Bruinhout's Profile

GitHub User: webfella

Site: http://www.webfella.com.au

Comments by Adrian Bruinhout

Avatar

Not a rails expert, but found the solution for anyone else with the issue. Rails 4 now uses strong params with protecting attributes now done in the controller

ruby
...

  def create
    respond_with Entry.create(entry_params)
  end

  def update
    respond_with Entry.update(params[:id], entry_params)
  end

...

  def entry_params
    params.require(:entry).permit(:name, :winner)
  end

...
Avatar

Great vid mate, however using Rails 4 I'm getting the following error on my create and update methods:

ActiveModel::ForbiddenAttributesError