Is it possible to define a sub directory in the views folder to put partials? In my config.load_paths in the environment.rb I''ve added an entry to the effect of "config.load_paths += %W( #{RAILS_ROOT}/app/ views/my_item/my_partials )" where I''ve placed partials but they can''t be found when referencing them from the views/my_item.rhtml file. Am I missing something? (it works fine when I place the partials in the same directory as my_item.rhtml file) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 7 May 2008, at 14:26, MaddyTheGoose wrote:> > Is it possible to define a sub directory in the views folder to put > partials? In my config.load_paths in the environment.rb I''ve added an > entry to the effect of "config.load_paths += %W( #{RAILS_ROOT}/app/ > views/my_item/my_partials )" where I''ve placed partials but they can''t > be found when referencing them from the views/my_item.rhtml file. Am I > missing something? (it works fine when I place the partials in the > same directory as my_item.rhtml file)config.load_paths is for something entirely different. If you render the partial foo/bar then it will render the partial app/views/foo/ _bar.html.erb (or whatever file type it happens to be) Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
config.load_paths is for libs i think if you want to render a partial in a special place, just give it the path: render :partial => "/my_path/my_partial" -- 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-/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 -~----------~----~----~----~------~----~------~--~---
I figured I must be off track with this. Thanks for pointing me in the right direction. On May 7, 9:51 am, Thorsten Mueller <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> config.load_paths is for libs i think > > if you want to render a partial in a special place, just give it the > path: > > render :partial => "/my_path/my_partial" > -- > Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---