I can successfully get my local server running with open source project kandan using ruby on rails, however as soon as I click the "create new account" button, it redirects me to the home page as expected but then the server crashes immediately.
This is the error I am getting on the server:
It would be great if someone could help me out!
EDIT
Here is the routes file
Kandan::Application.routes.draw do
devise_for :users, :controllers => {
:sessions => "sessions"
}
devise_scope :user do
authenticated :user do
root :to => "main#index"
get '/search' => "main#search"
resources :channels do
resources :activities
resources :attachments
end
resources :users, :only => [:index, :show]
get "/active_users" => "apis#active_users"
get "/me" => "apis#me"
get "/users/edit" =>"main#users_edit"
namespace :admin do
root :to => "admin#index"
post "/update", :to => "admin#update", :as => "update"
post "/update_user", :to => "admin#update_user", :as => "update_user"
post "/toggle_admin", :to => "admin#toggle_admin"
end
end
unauthenticated do
root to: "sessions#new"
end
end
# Pages Controller
get "/approval", :to => "pages#approval"
get "/suspended", :to => "pages#suspended"
get "/about", :to =>"pages#about"
end
It looks like a problem with a redirect in your controller. Look here:
This get is long after your POST to users. There are several GET requests between them, but you can see that this GET request is sending an 'undefined' id as a parameter. Whatever variable you are using to pass the ID is not properly initialized.
If you are doing browser-based testing (rather than TDD, et. al.), then I recommend installing the Better Errors gem. When an error is thrown it passes your browser a usable shell and a list of all the local variables. You can even raise an exception (
raise "STOP HERE"
) if you want the application to stop at a certain point. It is a crutch, and it is better to use one of several very well documented TDD approaches, but it is a very nice and fancy crutch.