# Site content blocks

**URL:** <https://www.ruby-forum.com/t/site-content-blocks/158808>\
**Category:** Rails\
**Created:** [January 28, 2009, 10:50am UTC](https://www.ruby-forum.com/t/site-content-blocks/158808 "2009-01-28T10:50:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![torp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@torp](https://www.ruby-forum.com/u/torp)\
**Post date:** [January 28, 2009, 10:50am UTC](https://www.ruby-forum.com/t/site-content-blocks/158808/1 "2009-01-28T10:50:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![torp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@torp](https://www.ruby-forum.com/u/torp)\
**Post date:** [January 28, 2009, 4:07pm UTC](https://www.ruby-forum.com/t/site-content-blocks/158808/2 "2009-01-28T16:07:58Z")

</div>

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

> **[M2i3 - Connecter les besoins aux solutions](https://m2i3.com/)**
>
> Nous sommes M2i3, des "socials-geeks" passionnés par le web, l'infonuagique et les logiciels. Nous vous présentons IncognitoDesk Après des an ...
