I am having problems with why my application returns 401 Unauthorized. Other actions in my Institutions controller work very well until they are logged in. However, this and the other page return 401. If they are logged in, these pages work fine, but they should not require a login. I even went so far as to clear the view and the action, but still the page returns 401. When debugging through the violinist, I just get a 302 redirect.
I tried exploring elsewhere and tried the solutions from Warden 401 Unauthorized Authentication without success.
Console
Started GET "/institutions/3" for 127.0.0.1 at 2013-04-25 14:38:15 -0400 Processing by InstitutionsController#show as HTML Parameters: {"id"=>"3"} β[1mβ[36mInstitution Load (0.0ms)β[0m β[1mSELECT `institutions`.* FROM `institutions` WHERE `institutions`.`id` = 3 LIMIT 1β[0m Load data... Load assets...
Then I submit the form, the method is set as GET
Started GET "/visit/schedule/preview?utf8=%E2%9C%93&selected_ids=4693" for 127.0.0.1 at 2013 -04-25 14:28:53 -0400 Processing by InstitutionsController#previewselectedvisits as HTML Parameters: {"utf8"=>"β", "selected_ids"=>"4693"} Completed 401 Unauthorized in 0ms Started GET "/users/sign_in" for 127.0.0.1 at 2013-04-25 14:28:53 -0400 Processing by Devise::SessionsController#new as HTML Rendered devise/sessions/new.html.erb within layouts/application (15.6ms) Rendered auth/_login.html.erb (0.0ms) Rendered auth/_loginmodal.html.erb (0.0ms) Rendered shared/_navbarout.html.erb (0.0ms) Rendered shared/_navbar.html.erb (0.0ms) β[1mβ[36mInstitution Load (0.0ms)β[0m β[1mSELECT name FROM `institutions` β[0m Rendered search/_searchbar.html.erb (0.0ms) Rendered search/_searchresults.html.erb (0.0ms) Rendered shared/_footer.html.erb (0.0ms) Completed 200 OK in 140ms (Views: 46.8ms | ActiveRecord: 15.6ms) Load assets...
Related Routes
devise_for :users match 'visit/schedule/preview' => 'institutions#previewselectedvisits', :as => :preview_visits, :via => :get match "institutions/:id" => "institutions#show", :as => :show_institution
rake routes
new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update cancel_user_registration GET /users/cancel(.:format) devise_invitable/registrations#cancel user_registration POST /users(.:format) devise_invitable/registrations#create new_user_registration GET /users/sign_up(.:format) devise_invitable/registrations#new edit_user_registration GET /users/edit(.:format) devise_invitable/registrations#edit PUT /users(.:format) devise_invitable/registrations#update DELETE /users(.:format) devise_invitable/registrations#destroy user_confirmation POST /users/confirmation(.:format) devise/confirmations#create new_user_confirmation GET /users/confirmation/new(.:format) devise/confirmations#new GET /users/confirmation(.:format) devise/confirmations#show user_unlock POST /users/unlock(.:format) devise/unlocks#create new_user_unlock GET /users/unlock/new(.:format) devise/unlocks#new GET /users/unlock(.:format) devise/unlocks#show accept_user_invitation GET /users/invitation/accept(.:format) devise/invitations#edit remove_user_invitation GET /users/invitation/remove(.:format) devise/invitations#destroy user_invitation POST /users/invitation(.:format) devise/invitations#create new_user_invitation GET /users/invitation/new(.:format) devise/invitations#new PUT /users/invitation(.:format) devise/invitations#update preview_visits GET /visit/schedule/preview(.:format) institutions#previewselectedvisits show_institution /institutions/:id(.:format) institutions
Gemfile
source 'https://rubygems.org' gem 'rails', '3.2.12' gem 'mysql2' gem 'execjs' group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' gem 'simple_form' gem 'devise' gem 'devise_invitable' gem 'omniauth' gem "omniauth-google-oauth2" gem 'omniauth-linkedin-oauth2' gem 'omniauth-facebook'