2012-04-17 31 views
1

沒有登錄我學習Ruby和設計以及誰沒有登錄某些原因的用戶,都沒有被重定向到登錄Ruby on Rails的 - 設計不是讓用戶日誌中,當用戶在

這裏是我的路線有:

scope :module => :mobile, :as => :mobile do 
    constraints(:subdomain => /m/) do 
     devise_for :users, :path => "", :path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "signup" }, :controllers => {:sessions => "sidebar/sessions"} 

     resources :home 

     resources :disclosures # Will have new, get, look up a disclosure 

     devise_for :users, :path => "", :path_names => 
      { :sign_in => "login", :sign_out => "logout", :sign_up => "signup" } 

    end 
    end 

,這裏是我的控制器:

class Mobile::HomeController < ApplicationController 
    layout "mobile/application" 
    before_filter :authenticate_user!, :only => [:edit, :update, :destroy] 

    def index 

    respond_to do |format| 
     format.html 
    end 
    end 

    def create 

    end 
end 

任何想法,爲什麼用戶不被重定向到登錄?現在,用戶正在被顯示在他只能看到身份驗證的頁面中。

謝謝!

回答

1

改變這一行:

before_filter :authenticate_user!, :only => [:edit, :update, :destroy] 

before_filter :authenticate_user!, :only => [:index, :edit, :update, :destroy] 
+0

奏效....謝謝!新手遺漏我:) – GeekedOut 2012-04-17 18:06:55