On Feb 10, 2008, at 8:54 AM, Matt wrote:
> I am rendering the partial "shared/list" from within a
controller.
> This partial in turn renders the partial "shared/listitem".
>
> My question is:
>
> Is there an option for render to inherit the location of the called
> partial so i can call the partial ''listitem'', or must i
specify the
> sub-partial as ''shared/listitem''. i.e. relative as
opposed to
> absolute.
>
> If not, can you think of a reason why this would be? It seems a
> nuisance to code all shared or cross-controller views with absolute
> locations and could provide problems with future application
> expansions.
>
> Any thoughts on the best-practice way to overcome this?
I create an instance var in application.rb which is a hash of paths I
will use throughout the application. I use that for all path
references. If I need to relocate things, there''s one place to make
that change.
I have a number of tibits for dealing with partials and layouts in an
article here:
http://www.railsdev.ws/blog/3/modular-page-assembly-in-rails/
--
def gw
writes_at ''www.railsdev.ws''
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---