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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:45:46+00:00 2026-05-16T01:45:46+00:00

For some reason, one of my models in rails is returning nil when I

  • 0

For some reason, one of my models in rails is returning nil when I call .new. This is only a problem in the controller. When I try on the console, it returns an object with nil attributes as I would expect. I suspect the problem is in my controller, but I have no idea.

This also happens when I call .all. Again, I can execute these commands manually from the command line without issue.

Here’s the controller code:

http://gist.github.com/502816

EDIT: Looks like a few of my other models are acting the same way. This problem is clearly deeper than this controller/model. I’m still very new to rails, so I’m not sure where to look to debug this.

EDIT2: A wise friend of mine helped me figure out that the controller action isn’t even being called. My before filter, however, is, but it is not redirecting. So somehow, the right controller is found, but the appropriate action isn’t called.

My server log SAYS the right action is being processed, but the actual function body doesn’t seem to execute.

  • 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-16T01:45:47+00:00Added an answer on May 16, 2026 at 1:45 am

    I think your problem is that all of your methods EventsController are declared to be private. Private methods cannot be called as actions – so you are having problems.

    Try to move private declaration and redirect_if_not_logged_in to the end of the file, i.e. after the destroy method.

    For more information how public/private/protected work in Ruby read this: http://www-users.math.umd.edu/~dcarrera/ruby/0.3/chp_04/features.html

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

Sidebar

Related Questions

For some reason, one of my Ruby on Rails classes produces this sort of
For some reason, this line of code is returning undefined for $(this).attr(href) $(a).attr(href, javascript:page('
for some reason when I try to call CocoaAsyncSocket's onSocket:didReadData:withTag method, it's failing and
For some reason one particular AJAX call of mine is getting a No parameterless
For some reason during loading one of the scenes in my game, the background
for some reason (and I think I know why), when more than one row
Over the weekend, for some reason, one of our servers has decided to start
I have some classes that, for one reason or another, cannot be or need
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
I created a new model in my rails app. Since it's a one-to-one relation

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.