I am somewhat new to rails and I am trying to create a User login. I went through the tutorial found here. At the end it had me add \"attr_accessible\" for mass assignment
No mass assignment allowed for Rails 4.1
You will have to try something like this.
class Person
has_many :pets
accepts_nested_attributes_for :pets
end
class PeopleController < ActionController::Base
def create
Person.create(person_params)
end
...
private
def person_params
# It's mandatory to specify the nested attributes that should be whitelisted.
# If you use `permit` with just the key that points to the nested attributes hash,
# it will return an empty hash.
params.require(:person).permit(:name, :age, pets_attributes: [ :name, :category ])
end
end
Refer
https://github.com/rails/strong_parameters