Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Mass assignment issue in spree_static_content #47

Closed
ethier opened this issue Apr 5, 2012 · 3 comments
Closed

Mass assignment issue in spree_static_content #47

ethier opened this issue Apr 5, 2012 · 3 comments

Comments

@ethier
Copy link

ethier commented Apr 5, 2012

When creating a new page an error is generated:

Can't mass-assign protected attributes: title, slug, body, meta_title, meta_keywords, meta_description, layout, foreign_link, position, show_in_sidebar, show_in_header, show_in_footer, visible

I've tried to update the models/spree/page.rb file to include attr_accessible for those attributes, but it is not working:

attr_accessible :title, :slug, :body, :meta_title, :meta_keywords, :meta_description, :layout, :foreign_link, :position, :show_in_sidebar, :show_in_header, :show_in_footer, :visible

@JDutil
Copy link
Member

JDutil commented Apr 5, 2012

Are you sure your app is using your updated Spree::Page model? Adding the attr_accessible should fix this. I'd suggest making sure your Gemfile points to your modified spree_static_content gem, bundle again, and restart your application. If that still doesn't fix the issue could you send a link to your updated spree_static_content commit to look at?

@ethier
Copy link
Author

ethier commented Apr 5, 2012

I'm using Spree 1.1.0.beta right now, so I hope I'm using the updated Spree::Page model. ;)

I've cloned local and updated my Gemfile to point to that repo. I've submitted a pull request with my changes.

@JDutil
Copy link
Member

JDutil commented May 3, 2012

This was fixed in the pull request #48

@JDutil JDutil closed this as completed May 3, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants