CamelCamelCamel
CamelCamelCamel

Reputation: 5200

Rails - Disable Nested Attributes in Mongoid / Active Record

In Mongoid embedded documents accepts nested attributes is on by default. How can one disable it?

Upvotes: 0

Views: 204

Answers (2)

Tyler Brock
Tyler Brock

Reputation: 30176

You can either use attr_protected to restrict given attributes from being mass assignable or use the inverse attr_accessible to allow only the given attributes to be mass assignable.

Upvotes: 0

Sławosz
Sławosz

Reputation: 11717

Maybe try use attr_protected macro?

Upvotes: 1

Related Questions