ruby on rails - Alternative for :id param -


i have resources :users , custom_id inside users table.

i want use link_to "user", user method choosing custom_id provide link field param.

my show action inside users_controller.rb:

...   @user = user.find(custom_id: params[:id]) ... 

in form use:

<%= link_to @user.name, @user %> 

because wrote in userscontroller:

...   @user = user.find(custom_id: params[:id]) ... 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -