P
Peter D Bethke
Hi All,
I'm moving to Ruby from another language and I'm working through the basics by altering an existing Rails project. One of the basic things I'd like to do is to highlight a link for example with the css id "current" when the current url matches a certain string.
I'm trying it first as in inline conditional, and failing miserably:
<%= (request.fullpath == '/home/menu') ? render :text => 'current' %>
Basically, I'm trying to say "if the fullpath = x, then output the string "current". I'm sure that the answer is simple.
Ruby is pretty cool, I'm enjoying it immensely.
Best,
Peter D Bethke
I'm moving to Ruby from another language and I'm working through the basics by altering an existing Rails project. One of the basic things I'd like to do is to highlight a link for example with the css id "current" when the current url matches a certain string.
I'm trying it first as in inline conditional, and failing miserably:
<%= (request.fullpath == '/home/menu') ? render :text => 'current' %>
Basically, I'm trying to say "if the fullpath = x, then output the string "current". I'm sure that the answer is simple.
Ruby is pretty cool, I'm enjoying it immensely.
Best,
Peter D Bethke