ruby - rails routing does not work -


i have following route explicitly defined in routes.rb

map.book_preview_v2 '/books/v2/:id', :controller => 'books', :action => 'show_v2' 

but, in logs, see following message:

2015-09-25 16:49:04 info (session: f561ebeab121cd1c8af38e0482f176b8) method /books/v2/519869.json (user: xxx:669052) params: {"controller"=>"books", "action"=>"v2", "id"=>"519869", "format"=>"json"}  actioncontroller::unknownaction (no action responded v2. actions: some_method_1, some_method_2, some_method_3, some_method_4, some_method_5, **show_v2**, some_method_6, , some_method_7): 

am missing convention on configuration thing? why in logs see action "v2" instead of "show_v2"?

actioncontroller::unknownaction (no action responded v2. actions: some_method_1, some_method_2, some_method_3, some_method_4, some_method_5, show_v2, some_method_6, , some_method_7):

why in logs see action "v2" instead of "show_v2"?

as per rails 2 default route

map.connect ':controller/:action/:id' 

it expects v2 action defined show_v2 action in route. changing route below should work

map.connect '/books/show_v2/:id', :controller => 'books', :action => 'show_v2' 

Comments