Routing parameter at the front
kkak10 opened this issue · 3 comments
kkak10 commented
When my routes config has:
Rails.application.routes.draw do
localized do
match '/:val/test' => 'test#index', :via => :get
end
end
controller:
def index
param_val = params[:val]
...
end
I would like to receive a param_val
as 'hihi' when requested by /en/hihi/test
but param_val
is 'en'.
How can we fix it?
tagliala commented
Hi,
sorry for the late reply
Does
Rails.application.routes.draw do
scope(':locale') do
localized do
match '/:val/test' => 'test#index', :via => :get
end
end
end
work for your use case?
tagliala commented
Closing here, feel free to comment if it does not solve your issue