[LRUG] Rails : Drying Up Views
Pratik Naik
pratik at thinkwares.com
Tue Sep 11 09:35:57 PDT 2007
In addition to what James said, you can also do "helper :all" . But
I'm not sure if it's an edge only thingy.
You might also wanna check out partial layouts in edge :
http://ryandaigle.com/articles/2007/8/3/what-s-new-in-edge-rails-partials-get-layouts
Having said that, I don't exactly understand the question.
-Pratik
On 9/11/07, James Adam <james.adam at gmail.com> wrote:
> Sharing helper methods is fairly simple - either include the helper
> module into your controller directly, or use the "helper :wotsit"
> syntax in the controller. If you find you are including the helper in
> lots of places, either have it included as part of
> ApplicationController, or add/include the methods into
> ApplicationHelper.
>
> Sharing partials or views between controllers is quite easy too - you
> can render a view or partial from another controller by calling
>
> render :action => 'other_controller/view'
>
> or
>
> render :partial => 'other_controller/my_partial'
>
> (note the lack of underscore as per usual with the partial example).
>
> Is this what you mean?
>
> James
>
>
> 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
> >
>
>
> --
> * J *
> ~
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
--
http://m.onkey.org
More information about the Chat
mailing list