I'm trying to use a custom route to go to /admin/home
but it keeps giving me the error: undefined local variable or method 'home_admins_path' for #<#<Class:0x007f8272855808>:0x007f8272b9f298>
when using = link_to 'Home', home_admins_path
When I run rake routes
it appears that path is valid:
home_admins_path GET /admins/home(.:format) admins#home
routes.rb
MyApp::Application.routes.draw do
devise_for :admins
get '/admins/home' => 'admins#home', as: :home_admins_path
resources :admins
root to: 'pages#home'
end
admins_controller.rb
class AdminsController < ApplicationController
load_and_authorize_resource
def home
render "admins/home.html.haml"
end
end