Hail Caesars!
I have the following text entry field in my view: <%text_field :order,
:company_name %>
However, company_name doesn''t really reside in the orders table. It
resides in the "company" table, which belongs to order, as follows:
Order.company.company_name. This is where my controller method
correctly saves it to. I added the company_name field to my orders
table as a temporary measure so I wouldn''t get a method not found
error. Companies belong to orders and each order has one company.
How can I change ":company_name" in my text_field helper to correctly
reflect the correct relationship between Orders and companies (that
is, Order.company.company_name instead of order[company_name] )?
Companies belonging to orders, rather than orders belonging to
companies, is correct for the business logic of this application.
Thanks in advance for your help.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.