Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActionView::Helpers::DateHelper problem in rails 2.2

#2807

hi i am using date_select helper for displaying month day and year.I am
trying to show month and year by the options of the helper as
<%=date_select( "post", "written_on", :discard_day => true)%>

But i am getting error as
undefined method styled_input' for<br/>

<ActionView::Helpers::DateTimeSelector:0x7f556dbb6678>

Reported by judearasu (at gmail) · June 16th, 2009 @ 09:33 AM

State: invalid
Milestone: 2.x
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. Andy Atkinson
    Andy Atkinson

    I have Rails 2.2.2 and 2.3.2 installed as gems. I attached a simple app that has a Post model and written_on date field. I was unable to reproduce your error by adding the :discard_day => true option to the DateHelper method. I tried the create and edit forms, and tried with Rails 2.3.2 and 2.2.2.

    June 18th, 2009 @ 06:59 AM

  2. judearasu (at gmail)
    judearasu (at gmail)

    Hi i have checked in your application helper is working fine, but its not displaying the prompt message
    Ex
    <%= f.date_select :created_at,:discard_day => true,:prompt=>{:month=>'Day'} %>

    June 18th, 2009 @ 09:02 AM

  3. Andy Atkinson
    Andy Atkinson

    Hello. Is the :prompt option a separate issue from the original bug you filed? If so I think it would probably be best to close this one and post a more specific bug.

    June 22nd, 2009 @ 06:17 AM

  4. judearasu (at gmail)
    judearasu (at gmail)

    Yes :prompt option is a separate issue.

    June 22nd, 2009 @ 07:21 AM

  5. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    I wasn't able to duplicate this issue either.

    ➜  code  rails -v
    Rails 2.3.5
    ➜  code  rails date_select
    ...
    ➜  code  cd date_select 
    ➜  date_select  script/generate model post written_on:date
    ...
    ➜  date_select  rake db:migrate
    ...
    ➜  date_select  script/generate controller posts new 
    ...
    ➜  date_select  script/server
    
    class PostsController < ApplicationController
      def new
        @post = Post.new
      end
    end
    
    <% form_for @post do |post| %>
      <%= post.date_select :written_on, :discard_day => true %>
    <% end %>
    

    or:

    <%= date_select("post", "written_on", :discard_day => true) %>
    

    I think this ticket can be marked as invalid, or resolved if it turns out the issue existed in previous versions.

    April 11th, 2010 @ 09:00 PM

  6. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    Cannot be duplicated.

    April 11th, 2010 @ 09:35 PM