Sounds like what you need is a virtual attribute. Check out the Railscast on
it at:
http://railscasts.com/episodes/16
On Wed, Mar 5, 2008 at 1:14 PM, Mark Mr
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Basically I need to know how to use forms fields when the attribute name
> for it
> doesn''t match a field in my database. I have a form like this.
>
> <td><%= date_select ''assessment'',
''ends_at_date'', :value => "Click
> here..." %>
> <%= time_select ''assessment'',
''ends_at_time''%></td>
>
> My database has a field called ends_at which is a datetime field that
> should have the combination of these 2 forms fields. However, I dont
> know how to interact with the values of form fields with ruby in order
> to do that. This gives me an error right now because there are no
> database fields called ends_at_date or ends_at_time to correspond to.
> Does anyone know how i can take the values of these fields and mess with
> them so i can input what i want in my ends_at field? Perhaps through the
> model or controller. Thanks alot :D
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
Henry
http://www.henrywagner.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---