我有以下的routes.rb路由錯誤
resources :api_users, :as => :users
get '/:controller(/:action(/:id))'
post "/:controller(/:action(/:id))"
get '/' => 'startsites#startsite'
我稱之爲application_controller.rb了以下行動:
def change_locale
if Settings.language_supported?(params[:locale])
session[:locale] = params[:locale]
I18n.locale = params[:locale]
end
case params[:goto]
when "user"
if current_user.nil?
redirect_to :action => :home
else
redirect_to :controller => :users
end
when "lecturer"
if current_user.nil?
redirect_to :action => :home
else
redirect_to :controller => :lecturers
end
else
redirect_to :startsites => :startsite
end
end
,我得到這個錯誤:
No route matches [GET] "/settings/change_locale"
我該如何解決這個問題?