Skip to content

Instantly share code, notes, and snippets.

@recursive
Created October 7, 2009 20:53
Show Gist options
  • Select an option

  • Save recursive/204443 to your computer and use it in GitHub Desktop.

Select an option

Save recursive/204443 to your computer and use it in GitHub Desktop.
def route_to_poly_controller(polymorphic_type, polymorphic_id, action = :show)
return {:controller => polymorphic_type.tableize, :action => action, :id => polymorphic_id}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment