hidden_field outside of object

I’m using form_for @object but i need to include in the form a value that’s not a valid method for the object, but the controller needs the value How do I do that?

I'm using form_for @object but i need to include in the form a value that's not a valid method for the object, but the controller needs the value How do I do that?

Where will this value come from (in the form)? Are you setting it using JavaScript or some other means? If you add attr_accessor :my_made_up_method_name to the model class, you can use the form builder macros to create a field for that attribute. You won't be able to set it to a value using Ruby (unless you use a callback to set it to some default value), but you can get the field to appear in the form that way.

Walter

Thanks