只是出于好奇:
怎么可能这个(相当难看的)Rails代码被美化/重构:
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
Run Code Online (Sandbox Code Playgroud)