ruby on rails - How to redirect to page if locale doesn't exist? -


can redirect "/en" page if locale doesn't exist in rails?

i use i18n , next code:

match '*path' => redirect('/'), via: :get 

but redirects path, not locale. how can use locales too?

in controller that

before_filter :check_locale  protected  def check_locale   redirect_to "/en#{request.path_info}" if params[:locale].blank? end 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -