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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:20:06+00:00 2026-05-23T13:20:06+00:00

I have a namespaced model quiz under Student, and I need to access a

  • 0

I have a namespaced model “quiz” under Student, and I need to access a model without a namespace of the same name. I can’t do Quiz.all because it’s in the namespace, how do I get the Quiz stuff for the model without the namespace?

My model is class Quiz < ActiveRecord::Base
The model is in app/models/quiz.rb
My controller is class Student::QuizzesController < ApplicationController
The controller is in app/controllers/student/quizzes_controller.rb

I also have another model that’s a namespaced version of quiz. class Student::Quiz < ActiveRecord::Base, and when I generated the model it made a student.rb model in the app/models directory that has this in it.

module Student

  def self.table_name_prefix

    'student_'

  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-05-23T13:20:07+00:00Added an answer on May 23, 2026 at 1:20 pm

    You can use ::Quiz to explicitly refer to the toplevel Quiz constant.

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

Sidebar

Related Questions

I have namespaced model Equipment::Feature and namespaced controller in my admin part Admin::Equipment::FeaturesController .
I have an Interface like this: namespace QuickRoutes.Model.Utilities { public interface IRoutesManager { bool
I have a class in my domain model root that looks like this: namespace
I'm using Doctrine ODM with MongoDB. I have a product model like this: namespace
I have the following models: WeatherForecast: namespace TravelAssistant.Model.HelperModels.Weather public class WeatherForecast:EntityBase<int> { public IList<DayForecast>
I have a model library (namespace Test.App.Model.EF ) with the Entity Framework implementation in
I have a code like this (C++): namespace models { class model { private:
I have a simple model namespace StackOverflow.Models { public class Test { public Test()
I have a code first model: namespace InternetComicsDatabase.Models { public class Issue { [Key]
I have a domain model and a view model as follows: Domain Model: namespace

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.