Linking To The Current Action
Join the DZone community and get the full member experience.
Join For FreeThis small snippet shows how to link to the current action. Although it's very easy to do, it doesn't seem to be documented anywhere. This comes in handy when your dealing with partials that are called in multiple actions and controllers.
<%= link_to "Insert Link Text", :action => controller.action_name %>
Opinions expressed by DZone contributors are their own.
Comments