I have no idea if this is possible or desirable, so I'd welcome comments on both. (As always, showing my level of competence! :)
I have a few different tool tips that need to be shown in various places on my page. They each show a slightly different tip, but are essentially the same. I wanted to put all of the tip html into one partial and then when I call <%= render '/path/tomy/partial/' %> pass along a variable that would be used evaluate the if/else logic inside the partial.
So something like this is what I was thinking, but can't seem to get it work.
On my view:
<%= render '/path/tomy/partial', options{:value => "1"} %>
Inside the partial
<% if :value == "1" %>
Show this tool tip text
<% elsif :value == "2" %>
Show this other tool tip text
<% else :value == "3" %>
Show this third version
<% end %>
Of course, the simple solution is to create three partials and just call them as needed. I suppose I'm just exploring here. Thanks so much for your thoughts!
Ryan