I have deployed my rails app to heroku, then, I got an error:
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
but, it works perfect locally at development mode, it seems there is configuration error between `devise` and `routing-filter` gem
if I visit: `
http://dcaclab.herokuapp.com`
my app will routed to: `
http://dcaclab.herokuapp.com/en/users/sign_in`so, why devise worked fine with routing-filter in development mode, but not in production ?
any idea please ?
The home controller:
class HomeController < ApplicationController
def welcome
end
def set_lang
locale = params[:id]
I18n.locale = locale
raise 'unsupported locale' unless ['ar', 'en' ].include?(locale)
redirect_to :back
end
end
Here is my routes.rb:
devise_for :users
resources :experiments
Rails.application.routes.draw do
filter :locale, :pagination, :uuid
end
match 'lang' => 'home#set_lang'
root :to => 'home#welcome'
2012-04-21T13:01:31+00:00 app[web.1]: Started GET "/en/users/sign_in" for 94.249.67.204 at 2012-04-21 13:01:31 +0000
2012-04-21T13:01:31+00:00 app[web.1]: ActionController::RoutingError (No route matches {:controller=>"devise/home", :action=>"set_lang", :id=>"ar"}):
2012-04-21T13:01:31+00:00 app[web.1]:
2012-04-21T13:01:31+00:00 app[web.1]: Parameters: {"locale"=>"en"}
2012-04-21T13:01:31+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2012-04-21T13:01:31+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/app/views/devise/_links.erb (0.4ms)
2012-04-21T13:01:31+00:00 app[web.1]: app/views/layouts/application.html.haml:17:in `_app_views_layouts_application_html_haml___1664922202454615355_30206680'
2012-04-21T13:01:31+00:00 app[web.1]:
2012-04-21T13:01:31+00:00 app[web.1]:
2012-04-21T13:01:31+00:00 app[web.1]: Completed 500 Internal Server Error in 6ms
2012-04-21T13:01:31+00:00 app[web.1]: Rendered vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/app/views/devise/sessions/new.html.erb within layouts/application (3.2ms)
2012-04-21T13:01:31+00:00 heroku[router]: GET
dcaclab.herokuapp.com/en/users/sign_in dyno=web.1 queue=0 wait=0ms service=14ms status=404 bytes=728