For me to keep my application DRY i need to be able to have partials that can be accessed from two views. How is would I go about doing this? Many thanks, jakx12 -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Jul 15, 2010 at 2:58 PM, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> For me to keep my application DRY i need to be able to have partials > that can be accessed from two views. How is would I go about doing this?render :partial => "folder/partial_file" That should be enough.> > Many thanks, >-- Leonardo Mateo. There''s no place like ~ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Further, you should strive to make all your partials accessible like this, by using :locals in the render and in the partial expecting variable, not @variable, if that makes sense. Cheers On Jul 15, 1:07 pm, Leonardo Mateo <leonardoma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Thu, Jul 15, 2010 at 2:58 PM, Zack Nathan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > For me to keep my application DRY i need to be able to have partials > > that can be accessed from two views. How is would I go about doing this? > > render :partial => "folder/partial_file" > That should be enough. > > > > > Many thanks, > > -- > Leonardo Mateo. > There''s no place like ~-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.