On Friday, January 19, 2018 at 12:09:38 PM UTC-5, Walter Lee Davis wrote: > > > > On Jan 19, 2018, at 11:35 AM, fugee ohu <fuge...@gmail.com <javascript:>> > 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-ta...@googlegroups.com <javascript:>. > > To post to this group, send email to rubyonra...@googlegrankoups.com > <javascript:>. > > 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. > > Thanks
-- 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/fc994013-7b6c-4622-bae1-c347296944e2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.