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 8429241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:16:51+00:00 2026-06-10T05:16:51+00:00

I have a engine inside the lib folder named Support. In that folder, I

  • 0

I have a engine inside the lib folder named Support. In that folder, I have a Ticket controller.

I have created an ability class in the main app and I’m trying to manage all the models for the admin role. When I call the Tickets controller, it throws the error:

NameError in Support::TicketsController#index uninitialized constant Ticket

The app/model/ability.rb file is:

class Ability 
  include CanCan::Ability

  def initialize(user)
    user ||= User.new
    if user.role? == :admin
      can :manage , :all
    end
  end
end

The lib/support/tickets_controller.rb file is:

module Support
  class TicketsController < Support::ApplicationController
    load_and_authorize_resource
    respond_to :html, :xml, :json

    def index
    end
  end
end
  • 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-10T05:16:52+00:00Added an answer on June 10, 2026 at 5:16 am

    If the model class is namespaced differently than the controller, you will need to specify the :class option.

    module Support
      class TicketsController < ApplicationController
        load_and_authorize_resource :class => Support::Ticket
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a game engine class that creates my main character instance and game
I have a Rails engine that defines a class method top(count) on a model
Using Google App Engine and Django. Whenever I have a db.ReferenceProperty() inside a model
I have a Google App Engine application that performs about 30-50 calls to a
I have an app which uses an engine. I generated a cell inside this
I have a Rails 3 app that I am turning into a Rails engine
The context : I have a rails engine (gem) that uses omniauth inside it
I have created a google-app-engine java project in Eclipse using Google's Eclipse plugin. My
for that i have created the url rewrite in the .htaccess inside the login
Let's say I created a mountable engine called 'Soho' that has a controller for

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.