2017-05-17 13 views
-1

このdevise routesエラーのスタックをスタックします。問題は私の生産 サーバでのみで、私のローカルでは問題ありません。ルーティングの問題Devits

私はPhusion Passenger Apacheを使用しています。私の生産セットアップのために。エラーはです。オーバーライドコントローラの

uninitialized constant User::RegistrationsController 

私のroutes.rbを

devise_for :users, :controllers => { registrations: 'user/registrations'} 

パス

app/controllers/User/registrations_controller.rb 

アプリ/コントローラ/ユーザー/ registrations_controller.rb

class User::RegistrationsController < Devise::RegistrationsController 
    before_filter :authenticate_person!, :redirect_unless_admin 


    def create 
     build_resource(sign_up_params) 
     resource.save 
     yield resource if block_given? 

    if resource.persisted? 
    if resource.active_for_authentication? 
    set_flash_message! :notice, :signed_up 
    #sign_up(resource_name, resource) 
    #respond_with resource, location: 
    after_sign_up_path_for(resource) 
    redirect_to new_user_registration_path 
    else 
    set_flash_message! :notice, :"signed_up_but_#{resource.inactive_message}" 
    expire_data_after_sign_in! 
    # respond_with resource, location: after_inactive_sign_up_path_for(resource) 
    end 
else 
    clean_up_passwords resource 
    set_minimum_password_length 
    respond_with resource 
end 
end 

private 

def redirect_unless_admin 
    unless current_person.is_a?(Admin)  
    redirect_to root_path 
    end 
end 


def sign_up_params 
    params.require(:user).permit(:username,:email, :password, :password_confirmation,:company, :branch, :branch_id) 
end 

def account_update_params 
params.require(:user).permit(:username, :branch, :company, :email, :password, :password_confirmation, :current_password) 
end 
end 

はひどく助けを必要としているおかげで。

+1

でしたですあなたの登録コントローラを表示してください?また、特に指定されていない限り、パスは常に小文字になりますが、問題の原因とは思われません。 – Mark

+0

@マーク登録してください.content.rb – coolshox

+1

パスは小文字で 'user'ではなく' user'ではありません – Iceman

答えて

-1

あなたのルート自体に問題があると思います。ユーザー/登録ではなくユーザー/登録でなければなりません。

それはまだ、仕事のルートのユーザー/登録時にそれを残す、とのあなたのコントローラを保存しない場合は、次の

app/controllers/users/registrations_controller.rb 

との一番上の行を次のように変更します

module Users 
    class RegistrationsController < Devise::RegistrationsController 

それを

EDITを修正する必要があります。そして、最初のコメントで述べたように、パスは、あなたはすべて小文字