How about creating a model (and a table) called contact
information....
You''re code will be a lot cleaner and meaningfull.
usually compagnies have multiple contacts they like to make visible,
having a model for such purpose should provide good starting point and
allow for expension (like one business contact, the invoicing contact,
etc.)
Regards,
Jean-Marc
http://m2i3.com/
On Jan 28, 1:10 am, torp
<br...-VkZrCH9kVznr2y9rUd+3GhCuuivNXqWP@public.gmane.org>
wrote:> newbie question:
>
> what is the best way in rails to make content managed data that
isn''t
> iterated? eg. on a ''contact us'' page i have an business
address field
> that the client needs to be able to update, and there are many other
> fields on the site that need to be content managed.... should i create
> one table that stores all this data and access it in the pages action?
>
> i''ve created a table called ''blocks'' which
contains fields ''id'',
> ''name'' and ''content''
>
> and in the controller
>
> def contactus
> address = Block.find(:first, :conditions => { :name =>
> "businessaddress"})
> end
>
> which i can then access from the view, except this seems cumbersome.
>
> better ideas?
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---