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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:10:58+00:00 2026-05-23T17:10:58+00:00

Ok so I made a model, controller, and some views for an ‘Event’ (didn’t

  • 0

Ok so I made a model, controller, and some views for an ‘Event’ (didn’t use scaffolding).

Anyways when going to the events route I get this error:

uninitialized constant EventsController::Events
app/controllers/events_controller.rb:4:in `index'

This is my events controller:

class EventsController < ApplicationController

  def index
    @events = Events.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @events }
    end
  end
end

Any thoughts on why this isn’t working?

  • 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-23T17:10:58+00:00Added an answer on May 23, 2026 at 5:10 pm

    You probably want Event.all, not Events.all. (When calling your model class directly, always use the singular form)

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

Sidebar

Related Questions

For some views I use just a controller (no model). How do I update
I have made a data model, and now I've made a 2nd version. All
I made a Java Applet with some Standard GUI Components on it. I used
I made a discovery some time back. Just follow these steps: Create a .doc/.xls/.ppt
I have some controller logic: public function seafood() { $this->set('title', 'Seafood restaurants in and
If we have really heavy-processes system where process spawning is made for some kind
I'm trying to make a log-in log-off with Ajax supported. I made some logic
I made this question in this if then else to display 2 views on
I made a blog database and created some tables in it. I have wriTten
I use a foreach in my View to loop over my strongly-typed Model and

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.