usage
<%= edit employee %>
result (html)
the helper
module ApplicationHelper
def edit(record)
name = record.class.name.underscore.humanize.downcase
link_to "edit #{name}", edit_polymorphic_path(record)
end
end
Pastie
Support Pastie
or read my
Pastie << self
blog
<%= edit employee %>
module ApplicationHelper
def edit(record)
name = record.class.name.underscore.humanize.downcase
link_to "edit #{name}", edit_polymorphic_path(record)
end
end