I want to modify my existing routing βgameβ inside routes.rb, but due to SEO I also need to configure 301 redirects for old links.
My old routing:
match 'games/:permalink/:id/(:page)' => 'games#show'
New routing:
match 'gierki/:permalink/(:page)' => 'games#show'
Here is the redirect I tried to do:
match 'games/:permalink/:id/(:page)' => redirect {|params| "/gierki/#{params[:permalink]}" + params[:page].nil? ? "" : "/#{params[:page]}" }
Above redirect does not work, here is the error:
wrong number of arguments (1 for 2)
Arti
source share