Skip to content

Instantly share code, notes, and snippets.

@djgraham
Created April 7, 2016 14:20
Show Gist options
  • Save djgraham/82424d585bb16e50ddf46802d3e48368 to your computer and use it in GitHub Desktop.
Save djgraham/82424d585bb16e50ddf46802d3e48368 to your computer and use it in GitHub Desktop.
def polymorphicable_path(polymorphicable, action: '')
url_for(
controller: polymorphicable.class.name.tableize,
action: action,
id: polymorphicable.id,
only_path: true
)
end
polymorphicable_path(Task.first.taskable, 'edit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment