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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:26:01+00:00 2026-05-15T22:26:01+00:00

We are currently in the process of upgrading our rails version and I have

  • 0

We are currently in the process of upgrading our rails version and I have come across some weird error in one of my date_select tags.

Here is the culprit:

    <%= date_select :consultant_assignment, :start_date, :order => [:day, :month, :year], 
:start_year => 5.years.ago.year, :end_year => 5.years.from_now.year, :use_short_month => true %>

This throws out an error like this:

NoMethodError in Profiles#show

Showing app/views/people/_upcoming_assignments.html.erb where line #46 raised:

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.size

Extracted source (around line #46):

43:           <label for="consultant_assignment_start_date"><%= _('Start') %>:</label>
44:           <% debugger %>
45:           
46:           <%= date_select :consultant_assignment, :start_date, :order => [:day, :month, :year], :start_year => 5.years.ago.year, :end_year => 5.years.from_now.year, :use_short_month => true %>
47:           
48:           
49:           

I have tried to trace this problem and it seems that the error is generated when I put in the :month option in the :order array. So when I do :order => [:day, :year] the page loads perfectly.

I have searched for the exact problem but being more of a front end deisgner, I’m not sure how to procede with this. Is this an error by my code? Or is it a deprecated method?

Here is the application trace:

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:746:in `_unmemoized_month_names'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/memoizable.rb:72:in `month_names'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:781:in `month_name'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:708:in `select_month'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:705:in `upto'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:705:in `select_month'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:898:in `send'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:898:in `build_selects_from_types'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:896:in `each'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:896:in `build_selects_from_types'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:646:in `select_date'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/date_helper.rb:920:in `to_date_select_tag_without_error_wrapping'

I have googled about unmemoized month names but I found nada.

Okay, I’ve tried taking out the whole :order clause just to make the darn thing work. This time it doesn’t throw an error but the tag doesn’t appear! I tried checking in irb and apparently my date_select tag is not returning any select tags, but just a bunch of hidden tags!

I tried this with the default rails example:

date_select("post", "written_on")

irb returns this:

=> “\n\n\n”

as you can see, no select tag anywhere. I tried datetime_select and I see a select tag in there. So what’s the deal with 2.3.8’s date_select?

  • 1 1 Answer
  • 1 View
  • 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-15T22:26:01+00:00Added an answer on May 15, 2026 at 10:26 pm

    It seems it is a problem with i18n as rails can’t see the month names declared for some reason(it SHOULD see it since the default lang is en). Actually for some reason, it doesn’t see the default language. Anyway our quick fix for now was to add a MONTH_NAMES constant in constants.rb and add that to the options in date_select.

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

Sidebar

Related Questions

We are currently upgrading a current data import process we have written in C#.
We currently have a process where we receive an inventory file from a vendor
I'm currently in a process of creating a new C project and I have
I'm currently in the process of upgrading old II6 automation scripts that use the
I'm currently in the process of upgrading the TFS server from 2008 to 2010
I have tasked with upgrading a CF Framework 1.1 suite of apps. Currently, the
I'm in the process of upgrading my rails app originally in ruby 1.8.7 and
In the process of upgrading a pre-1.4 Magento site to version 1.4.1.2, I've run
I have a client who currently has one server with Magento and his admin
We've got a process currently which causes ASP.NET websites to be redeployed. The code

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.