ruby - Rails Routing Admin Error -


i have admincontroller

class admin::admincontroller < applicationcontroller   before_filter :is_admin?    def dashboard    end    def is_admin?     redirect_to root_path, :flash => { :alert => "you not admin!" } if !current_user.admin?   end  end 

and other controller inherits above:

class admin::competitionentriescontroller < admin::admincontroller   before_action :set_competition_entry, only: [:show, :edit, :update, :destroy] .... end 

my route file is:

foo::application.routes.draw   root 'competition_entries#index'    devise_for :users   resources :competition_entries    namespace :admin     root 'admin#dashboard'     resources :competition_entries   end  .... .. . end 

now why getting error when trying reach 'http://localhost:3000/admin'

missing template admin/admin/dashboard... 

i getting admin? why? don't want use scopes want use namespaces.

thanks.

routes not affect default search paths templates. if controller class named foo::barcontroller, rails templates in app/views/foo/bar/ unless specify otherwise.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -