Just out of curiosity:
How could this (rather ugly) Rails code be prettified / refactored:
def section_link(name, path)
link = link_to(name, path)
if name != controller.controller_name.titlecase
link
else
link_to(name, path, :class => 'current')
end
end
1 Answer