0

私はこのAdminControllerを持っています

class Admin::AdminController < ApplicationController
  before_filter :is_admin?

  def dashboard

  end

  def is_admin?
    redirect_to root_path, :flash => { :alert => "You are not an admin!" } if !current_user.admin?
  end

end

そして、上記から継承するこの他のコントローラー:

class Admin::CompetitionEntriesController < Admin::AdminController
  before_action :set_competition_entry, only: [:show, :edit, :update, :destroy]
....
end

私のルートファイルは次のとおりです。

Foo::Application.routes.draw do
  root 'competition_entries#index'

  devise_for :users
  resources :competition_entries

  namespace :admin do
    root 'admin#dashboard'
    resources :competition_entries
  end

....
..
.
end

http://localhost:3000/admin' 'に到達しようとすると、なぜこのエラーが発生するのですか?

Missing template admin/admin/dashboard...

この余分な管理者を取得していますか? なんで?スコープを使用したくない 名前空間を使用したい。

ありがとう。

4

1 に答える 1