2011-08-24 2 views
0

내 응용 프로그램이 하위 도메인과 작동하므로 사용자가 등록 프로세스 중 하위 도메인을 가져와야합니다. request.subdomain 또는 내 맞춤법 current_subdomain으로 만들 수 있으며 모든 앱에서 작동합니다.레일 3 - 확인 이메일을 생성 할 때 Devise 호스트 변경

하지만 Devise는 절대로 사용하지 않습니다. 내 마지막 시도는 전혀 성공하지 않고 RegistrationsController 무시합니다.

class RegistrationsController < Devise::RegistrationsController 
    def new 
    @subdomain = current_subdomain 
    puts @subdomain + " ON NEW" 
    resource = build_resource({}) 
    respond_with_navigational(resource, @subdomain){ render_with_scope :new } 
    #super 
    end 

    def create 
    @subdomain = current_subdomain 
    puts @subdomain + " ON CREATE" 
    super 
    end 
end 

과정 중에는 puts가 완벽하게 작동하지 않습니다. 이메일에 생성

링크는 기본 고안보기에, 나는 그런 식으로 구성 : 평소처럼

<p><%= link_to 'Confirm!', confirmation_url(@resource, :confirmation_token => 
@resource.confirmation_token, :host => @subdomain+".lvh.me:3000") %></p> 

은 내 하위 도메인이 전무 말합니다. 내가 어떻게 이걸 만들 수 있니?

감사합니다.

How To: Send emails from subdomains

유증이 ActionMailer 구성을 사용하고, 코드가 그 영향을주지 않습니다

답변

0

이에 관한 고안 위키 위키 기사가있다.

+0

감사합니다. –

관련 문제