Let’s say I have a “main” controller/view and a “sub” controller/view.
If I have defined a partial in “main” for the site header
(_site_header.rhtml) can I share it with “sub” or does “sub” have to
duplicate it, use a symbolic link to the file, or convert the cool
partial into an ugly helper?
It would be nice to have a shared placed for partials. Similar to
app/helper/application.rb.
I know I could use a helper, but when it comes to views, partials are so
much nicer.
I usually create a folder under views called “shared” and then put all
my
shared partials in there. I then reference them from any controller view
with
render :partial => ‘shared/_partial’
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.