[LRUG] Rails : Drying Up Views
Jason Lee
jlsync at gmail.com
Tue Sep 11 09:23:22 PDT 2007
the resources_controller plugin (AKA the future of rails) makes it really
easy write polymorphic views and polymorphic controllers.
I hear that resources_contoller (
http://blog.ardes.com/articles/2007/09/05/resources-controller-update )
might be a topic at the next monthly LRUG.
For sharing partials, simply_helpful/rails edge gives you
render :partial => @member # e.g. where @member = @post
and
render :parital => @collection # e.g. where @collection = @posts
which will automatically locate and use the correct partial (e.g.
app/views/posts/_post.erb
Jason.
On 9/11/07, Anthony Green <Anthony.Green at bbc.co.uk> wrote:
>
>
>
> Does anyone have any techniques for sharing view code generators
> (partials, helpers, yielding to content_for) across actions in different
> controllers.
>
> I¹m finding most techniques blogged about only deal with situations where
> there is more commonality between view/actions within a controller than
> view/actions (with the same name) across controllers.
>
>
> --
> Anthony Green
> Client Side Developer - Programme Information Tool
> Audio & Music Interactive
> BBC Future Media & Technology
>
>
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in
> reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20070911/03f72ca7/attachment-0003.html>
More information about the Chat
mailing list