Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:55:27+00:00 2026-05-28T16:55:27+00:00

I feel like this may be a dumb question, but it’s late and my

  • 0

I feel like this may be a dumb question, but it’s late and my head is melting a bit.. So I appreciate the assistance.

I’m trying to map the url http://localhost:3000/admin to a dashboard controller but i’m epically failing. Maybe this isn’t even possible or the completely wrong idea but anyway my routes looks like this and yes

namespace :admin do
  resources :dashboard, { :only => [:index], :path => '' }
  ...
end

and my simple dashboard_controller.rb

class Admin::DashboardController < ApplicationController
  before_filter :authenticate_user!
  filter_access_to :all

  def index
    @schools = School.all
  end
end

and my view is located in views/admin/dashboard/index.html.erb

thanks for any input

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:55:27+00:00Added an answer on May 28, 2026 at 4:55 pm

    If all you’re trying to do is route /admin to that dashboard controller, then you’re overcomplicating it by namespacing it like that.

    Namespacing with a nested resource like that would mean that it would be /admin/dashboards for the :index action instead of having a clean /admin route (and you can verify that by running rake routes at the command line to get a list of your routes).

    Option 1: You meant to namespace it like that

    # putting this matched route above the namespace will cause Rails to 
    # match it first since routes higher up in the routes.rb file are matched first
    match :admin, :to => 'admin/dashboards#index'
    namespace :admin do
      # put the rest of your namespaced resources here
      ...
    end
    

    Option 2: You didn’t mean to namespace it like that

    Route:

    match :admin, :to => 'dashboards#index'
    

    Controller:

    # Remove the namespace from the controller
    class DashboardController < ApplicationController
      ...
    end
    

    Views should be moved back to:

    views/dashboards/index.html.erb
    

    More info: http://guides.rubyonrails.org/routing.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like this may be a dumb question but I have spent a
This may be a super dumb question, that I feel like I should know
I feel like this is a stupid question, but I can't think of a
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
This may seem like a silly question, but what are the functional differences, if
I feel like this may be a trivial problem for most people but I'm
This may be a question for Server Exchange but I am starting to feel
This may be a very stupid question and it's making feel like my brain
I feel like this is something I should already know, but I'm just not
I feel like this is easy but I am missing something... Using jQuery, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.