I have a chunk of rhtml that gets reused by several views in several
controllers. I make partial out of it _foo and call it with
<%= render :partial =>'bar/foo' %>
# RAILS_ROOT/app/views/bar/_foo.rhtml
(note I'm not calling with a collection.) Is there a way to send a
variable to the partial? the doc says i can use :locals => { :name =>
'val' } but what I want to do is alias :name to another variable. I
can always set some class variable @var and using that inside the
partial, but I want to make it explicit what it is that I'm passing to
the partial.
also, is this the way to share something among views? I'm aware of
layouts but that seems to be for whole page content, rather than
common snippets.
an O/T question. what is the font used in the pdf for the code
portion? it's a nice fixed monospace font and I'm always on the
lookout for good monospace fonts to use for coding Currently I use
Lucida Console but it has a problem in that commas and periods look
too much alike.
Well, given that I tend to write such things at the moment I reach my epiphany about the topic, I can very easily forget what I write I've been pointed to my own advice more than once