is it possible to include a partial from within the global
application.html.erb?
I have a google ad in my application.html.erb I would like to move
it to a partial _google.html.erb in my layouts directory to keep
things CLEAN… but i guess ERB is only looking in the current views
directory not the layouts dir… would not make sense to move it to a
partial and then duplicate the _google.html.erb in all views, thats
not very DRY…
On Sun, Jan 06, 2008 at 02:37:27PM -0800, spokra wrote:
is it possible to include a partial from within the global
application.html.erb?
I have a google ad in my application.html.erb I would like to move
it to a partial _google.html.erb in my layouts directory to keep
things CLEAN… but i guess ERB is only looking in the current views
directory not the layouts dir… would not make sense to move it to a
partial and then duplicate the _google.html.erb in all views, thats
not very DRY…
I often create a shared directory in app/views for such things. In your
case, you’d have app/shared/_google.html.erb and refer to it as:
<%= render :partial => ‘/shared/google’ %>
–Greg
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.