2012-04-18 3 views
1

나는이 경로가 나는 템플릿을 확신 할 때 템플릿 오류를 누락 :루비 레일에 - 나는

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 => "mobile/sessions"} 

     resources :home 

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

이 컨트롤러 : /app/views/mobile/sessions/new.html.haml

:
class Mobile::SessionsController < ApplicationController 
    def create 
    end 
end 

이 디렉토리 아래

이며 new.html.haml 파일의 코드입니다.

= content_for :page_title do 
    = t :page_title_login 
= content_for :primary_content do 
    #login_box 
    .span6 
     #traditional-login 
    .span4 
= content_for :before_closing_body_tag do 
    configure_login_form(#{request.xhr?.to_s.downcase}); 
내가 로그인 후

는하지만, 브라우저에서이 오류를 얻을 :

시스템 내가 new.html.haml 파일이없는 것으로 생각하는 나에게 제안
Missing template mobile/sessions/create, application/create with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:haml, :erb, :builder]}. Searched in: * "/Users/alexgenadinik/projects/cmply/cmply-app/app/views" * "/Library/Ruby/Gems/1.8/gems/ckeditor-3.6.3/app/views" * "/Library/Ruby/Gems/1.8/gems/kaminari-0.13.0/app/views" * "/Library/Ruby/Gems/1.8/gems/devise-2.0.4/app/views" 

. 하지만 분명히 그 파일이 있습니다. 그래서 나는 그 문제가 무엇인지 모른다. 그리고 내가 잘못한 생각?

미리 감사드립니다.

답변

3

여기서 오류는 new.html.haml 파일이 누락 된 것이 아닙니다. create.html.haml 또는 create 액션에서 리디렉션이 누락되었습니다. 보통은 로그인 후 리디렉션, 그래서 이런 식으로 컨트롤러 액션을 변경해보십시오 :

class Mobile::SessionsController < ApplicationController 
    def create 
    redirect_to root_url 
    end 
end 

을 또는 당신이 원하는 목적지 방문자는 바람에.

+0

감사합니다. 많은 의미가 있습니다. :) – GeekedOut

+0

실제로 이것을 수행 한 후에 오류가 발생했습니다. 어쩌면 내 경우에는 root_url로 리디렉션되지 않아야 할 수도 있습니다. root_url은 어디에 정의되어 있습니까? user_home 또는 그와 비슷한 것으로 리디렉션해야 할 것입니다. 나는 긁어 모으지만 아무 경로도 root_url처럼 보이지 않는다. – GeekedOut

+0

나는 내 레이크 경로에있는 mobile_home 경로와 같이 갈 필요가있다. 그러나 그렇게 할 때, 정의되지 않은 지역 변수 나 메쏘드'mobile_home 'for # GeekedOut