On 11/24/06, Chris T
<ctmailinglists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:>
> Anyone?
>
> -------- Original Message --------
> Subject: named_paths in non AR/AC class
> Date: Thu, 23 Nov 2006 19:51:35 +0000
> From: Chris T
<ctmailinglists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Reply-To: ctmailinglists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>
>
>
> I''ve got a Sidebar class which handles the generating of various
> sidebars, and I''d like to be able to insert a named path as one of
its
> attributes (each sidebar is fed into the sidebar partial, so the feeds
> sidebar might have the Sidebar#more_info_link pointing at the RESTful
> resource for editing/managing the users feeds.
>
> Can anyone point me in the direction of how to include the
> edit_feed_path (for example) method in the Sidebar class...
>
> Thanks
> CT
>
>
Include the Sidebar into the controller where you need it, or the
ApplicationController if you need it across the app. Named routes
depend upon the controller state, so you can''t easily include them in
other classes. You want to do the opposite - include Sidebar into the
controller.
- rob
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---