Say I have a “Member” ActiveRecord object with a typical integer id
attribute, and a string ‘username’ attribute.
If I generate routes for members using map.resources :members, then the
output from the edit helper is:
edit_member_path(@member) => “members/23/edit”
My goal is that I really want:
edit_member_path(@member) => “members/billybob/edit”
Where instead of using .id it uses .username so that the links generated
by all of the different helper methods are prettier and memorable.
Is this possible via some kind of option? Can I simply replace these
helper methods with new implementations? I don’t even know where these
implementations are or what they really look like.
Thanks.