usage

1
<%= edit employee %>

result (html)

1
<a href="/employees/1/edit">edit employee</a>

the helper

1
2
3
4
5
6
module ApplicationHelper
  def edit(record)
    name = record.class.name.underscore.humanize.downcase
    link_to "edit #{name}", edit_polymorphic_path(record)
  end
end