Take the 2-minute tour ×

Is there a easy way to add a new permitted parameter to controllers in Spree without altering the defaults ?

I'm trying to change the orders_params method in OrdersController.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

You don't need to override anything, you have to do this in your spree initializer

To add a strong param to products controller...

Spree::PermittedAttributes.product_attributes << :new_attribute

and so on..

check this file: https://github.com/spree/spree/blob/master/core/lib/spree/permitted_attributes.rb?source=c

or this blogpost: http://blog.crowdint.com/2014/06/24/how-to-add-custom-attributes-in-spree.html

share|improve this answer
Nice @Steven, that is even better. Thanks –  Cassio S. Cabral Mar 4 at 23:32

You'll probably want to override this function:


to include the parameters you want. The Spree Logic Customization Guide should give you instructions on how to override that method in that class easily.

share|improve this answer
Yeah that was the droid I was looking for. Thanks. –  Cassio S. Cabral Jan 24 at 3:36

Your Answer


