I want to change my existing 'game' routing inside routes.rb, but because of SEO I need also to setup 301 redirect for old links.
My old routing:
match 'games/:permalink/:id/(:page)' => 'games#show'
New routing:
match 'gierki/:permalink/(:page)' => 'games#show'
Here is redirection which I tried to to do:
match 'games/:permalink/:id/(:page)' => redirect {|params| "/gierki/#{params[:permalink]}" + params[:page].nil? ? "" : "/#{params[:page]}" }
Above redirect is not working, here is an error:
wrong number of arguments (1 for 2)