[Ruby] RoR coding questions / select_date

Frederick Alger fred at fredalger.net
Mon Jul 31 10:39:20 PDT 2006


Try:

<%= date_select('foo', 'date', :order => [:month, :day, :year]) %>

~ Fred.

On Jul 31, 2006, at 10:00 AM, Mike Mondragon wrote:

> Is ruby at zenspider.com the main list to discuss RoR coding questions  
> (and yes
> I've searched google and the RoR wiki already)?
>
> Thanks
> Mike
>
> Noob question.
> In case this is the right list, I created a controller that uses  
> scaffold
> and am going back and overrideing the update.rhtml view but want to  
> use the
> controller's default update method.  My model has a date field.  In  
> my new
> update.rthml, like scaffold, I use the ActionView::Helpers::DateHelper
> select_date to display my model's date field.  Problem is I can't  
> seem to
> get the signature of the select_date correct; it seems like I need  
> to use
> the :prefix option, but when the post goes back to the controller  
> the date
> field is not correctly updated.
>
> My noob mind thinks this should do it in update.rhtml
> <%= select_date( @foo.date, :prefix => "foo[date]" ) %>
> but it doesn't and makes me sad.
>
> Bonus to you if you can show me what option to select_date will  
> reorder the
> html rendering of the date's selects from year/month/day to month/ 
> day/year.
>
> Please correct me if I've used the wrong lingo in describing my  
> problem.
>
> Thanks again.
> _______________________________________________
> Ruby at zenspider.com
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby



More information about the Ruby mailing list