> On Jan 19, 2018, at 11:35 AM, fugee ohu <fugee...@gmail.com> wrote:
> 
> 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

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/219238f6-f3ec-4170-95d5-3246d167db5b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1F671874-A1D7-4C7F-B251-4E4ED2C40ACE%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to