Application helper and tri-state images


#1

I’ve come up with a very hackish way of creating a tri-state image
navbar. I don’t like it but it works pretty well. I would love to know
the ‘rails’ way of doing this or even just a suggestion. Here’s my
helper.
module ApplicationHelper

we use this function to create the tri-state image with rollovers

todo I need to use a good css trick for this and not this function

def navigation_bar
links = [ ‘home|/store/home’,
‘about|/store/about’,
‘necklaces|/store/browse/necklaces’,
‘bracelets|/store/browse/bracelets’,
‘earrings|/store/browse/earrings’,
‘archives|/store/archives’,
‘journal|/journal’,
‘customer|/store/customer’,
‘cart|/store/display_cart’]
navbar = String.new
links.each do |link|
image,action = link.split(’|’)
if(@current_page.to_s == image)
navbar << %Q{}
else
navbar << %Q{}
end
end
navbar
end

end

charlie bowman
recentrambles.com