Render partials in folders

Right now I have partials in a view folder corresponding with my

ie: controller: example, view: example/_partial.rhtml
and I call it with render :partial => ‘partial’

How do I add the partial to another folder and call it?
ie: controller: example, view: example/new_folder/_partial.rhtml
render :partial => ‘new_folder/partial’ # does NOT work

Hi Larry ~


render :partial => ‘/example/new_folder/partial’

~ Ben

Thanks Ben,

I got it working by appending an underscore to the physical folder name

so now:
render :partial => ‘new_folder/partial’ # DOES work

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs