ruby on rails - No route matches for new show route -
ruby on rails - No route matches for new show route -
actioncontroller::routingerror no route matches {:controller=>"user_prices", :action=>"show".....
this error getting when changed route in view to:
<td class="show-link"><%= link_to "show", show_price_path(user_price) %></td>
which new route:
match "/:id/:product_name/:purchase_date/:price", :to => "user_prices#show", :as => :show_price
what have can utilize route see user prices?
the route specifying
/:id/:product_name/:purchase_date/:price
requires 4 parameters created. passing in 1 object, assume meant id. route have specified, need like.
show_price_path(:id=>user_price.id, :product_name=>product_name_from_user_price, :purchase_date=>purchase_date_from_user_price, :price=>price_from_user_price)
ruby-on-rails ruby ruby-on-rails-3
Comments
Post a Comment