Re: Partials and config.load_paths

Frederick Cheung
Wed, 07 May 2008 13:50:29 -0000

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