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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:47:55+00:00 2026-05-25T19:47:55+00:00

I found a gazillion answers for my issue if I was using Mongo, but

  • 0

I found a gazillion answers for my issue if I was using Mongo, but none of the ones I see work out here since I am not using mongo.

Basically I have a report_controller.rb that has a very simple method defined:

def donations_by_season
  @donations = Donation    
end

and a very simple report/donations_by_season.html.erb as follows:

<%= form_for @donations do |f| %>
  Stuff Will go here... such as fields to select a date for the season we wish to view.
<% end %>

There is no report model, just a controller and views.

But when I attempt to view /reports/donations_by_season
I immediately get:

undefined method to_key' for #<Class:0x00000114d85918>

What should I do to fix that? Am I doing my form incorrectly since there is no model associated with reports?

  • 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-25T19:47:56+00:00Added an answer on May 25, 2026 at 7:47 pm

    You should never be assigning an instance variable to point to a class object like this. You probably want this:

    def donations_by_season
      @donations = Donation.all
    end
    

    Note the .all versus just leaving it blank. You could also do .new or a litany of other methods, depending on what you’re trying to do.

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

Sidebar

Related Questions

Found some similar questions but no answers that work. Right now I am doing
Found related questions but not the exact variant so I am posting a very
Found this Multimap containing pairs? , but it is not much help How would
Found a similar post here but I am running a Mac so the first
Found the function which position the image(s) in the multiscaleimage... but I'm not sure
Found this related post, https://stackoverflow.com/questions/7139/should-a-first-release-be-an-0-1-version-or-1-0b , but it is not about Ruby Gems. I
Found a bunch of other threads about comboboxes in WPF datagrid, but none that
Found plenty of questions that were similar, but nothing that answers my own problem.
Found this recently, but can't for the life of me figure out how the
FOUND OUT THE ANSWER: ITS DISPLAY:BLOCK;. PLEASE DO NOT DOWN VOTE THIS ANY MORE

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.