My Rails views and controllers are littered with redirect_to
, link_to
, and form_for
method calls. Sometimes link_to
and <
Following the idea of @Prathan Thananart but trying to not destroy nothing. (since there is so much magic involved)
class Person < Contact
model_name.class_eval do
def route_key
"contacts"
end
def singular_route_key
superclass.model_name.singular_route_key
end
end
end
Now url_for @person will map to contact_path as expected.