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

  • Home
  • SEARCH
  • 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 9123887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:26:51+00:00 2026-06-17T06:26:51+00:00

I am using devise and cancan in my app. Both are working. I have

  • 0

I am using devise and cancan in my app. Both are working.

I have a User model and I have just added (using scaffolding) a new model called Purchase.

Before the Purchase model was added i also have a dashboard controller (which just shows a single page at the moment, dashboard#show) and is the page that gets loaded after login at localhost:3000/dashboard

When a user is not logged in, i can access localhost:3000/purchases. But when the user is logged in I cannot. I can access purchase/1 but not /purchases.

Any idea what is going on here? The error it gives me is

“No route matches {:action=>”show”, :controller=>”dashboard”}”

Dashboard Controller

class DashboardController < ApplicationController
    def show
        @user = User.find(params[:id])
        authorize! :read, @user
    end

end

Routes.rb

App::Application.routes.draw do
  root :to => 'static_pages#index'
  match '/about', :to => 'static_pages#about'
  match '/error', :to => 'static_pages#error'
  devise_for :users

  resources :users

  resources :dashboard

  resource :visitors, :only => :create # POST to visitor_path to create a visitor

  resources :purchases

Rake Route

                    root        /                              static_pages#index
                   about        /about(.:format)               static_pages#about
                   error        /error(.:format)               static_pages#error
        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
           user_password POST   /users/password(.:format)      devise/passwords#create
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                         PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
       user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy
                   users GET    /users(.:format)               users#index
                         POST   /users(.:format)               users#create
                new_user GET    /users/new(.:format)           users#new
               edit_user GET    /users/:id/edit(.:format)      users#edit
                    user GET    /users/:id(.:format)           users#show
                         PUT    /users/:id(.:format)           users#update
                         DELETE /users/:id(.:format)           users#destroy
         dashboard_index GET    /dashboard(.:format)           dashboard#index
                         POST   /dashboard(.:format)           dashboard#create
           new_dashboard GET    /dashboard/new(.:format)       dashboard#new
          edit_dashboard GET    /dashboard/:id/edit(.:format)  dashboard#edit
               dashboard GET    /dashboard/:id(.:format)       dashboard#show
                         PUT    /dashboard/:id(.:format)       dashboard#update
                         DELETE /dashboard/:id(.:format)       dashboard#destroy
                visitors POST   /visitors(.:format)            visitors#create
               purchases GET    /purchases(.:format)           purchases#index
                         POST   /purchases(.:format)           purchases#create
            new_purchase GET    /purchases/new(.:format)       purchases#new
           edit_purchase GET    /purchases/:id/edit(.:format)  purchases#edit
                purchase GET    /purchases/:id(.:format)       purchases#show
                         PUT    /purchases/:id(.:format)       purchases#update
                         DELETE /purchases/:id(.:format)       purchases#destroy
  • 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-06-17T06:26:52+00:00Added an answer on June 17, 2026 at 6:26 am

    Singular must be resource, else resources

    resource :dashboard
    resource :visitor, :only => :create
    

    or

    resources :dashboards
    

    depending in what the task is

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

Sidebar

Related Questions

So I am using Devise for user authentication in my rails app. I have
Using devise , I have a User model. I do not have a user
I have a Rails 3.1 (RC5) app with Devise and CanCan. Both are configured
I am using devise with CanCan. I am using my user model. My user
I am using Devise and Cancan gems on a Rails 3.1 app. I added
I have two entities. User and Role. I am using Devise and CanCan. They
I have been using devise for authentication and cancan for authorization in my application.
I have a rails app that is using Devise perfectly in development. I have
I am using Devise and I have it so a User clicks log in
I'm using devise and cancan in a Rails 3.2 project. I have an event

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.