ruby on rails - Replacing :id from routes without breaking the convention -


i replaced :id on resource routes in rails 3 hash generated. i'm annoyed fact i'm writing less conventional code (e.g. link_to edit_user_path(@user) written link_to '/users/#{@user.user_hash}'). i'm wondering, therea smarter way this?

class user < activerecord::base   def to_param     user_hash   end end 

and edit_user_path(@user) work you


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -