Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

emclab's Profile

GitHub User: emclab

Comments by

Avatar

Full of information for upgrading!

Is there any reason for putting the following line in config/environments/development.rb by default?

=# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict

The rails app is going to throw out mass_assignment error if a protected attribute is submitted on a form. I can not think of a good reason for doing that by default in development.

Avatar

We are trying to make the sample code working on post and user (instead of product and category) with user has_many posts and a post belongs_to a user. However there is a network error below. (even when source: was changed to source: ["choice1", "choice2"] and data: (autocomplete_search :@users.map(&:name)} in view file

"NetworkError: 404 Not Found - http://localhost:3000/ajax/users?term=cha"

Any idea about fixing the error?

Avatar

Here is the error running under 3.1.0. Can not figure out why. Any suggestions? thanks.

=========================error===
wrong number of arguments (1 for 0)

Rails.root: D:/rails_proj/emclab-failed
Application Trace | Framework Trace | Full Trace

config/initializers/accessible_attributes.rb:7:in mass_assignment_authorizer'
app/controllers/categories_controller.rb:20:in
create'