Forum: Ruby on Rails select_xxx helper and default value

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
fredrikbach (Guest)
on 2006-12-29 15:27
(Received via mailing list)
Hi there,

I am struggling with handling the default day/month/year in the
select_xxx helper methods. I currently have:

<div id="date_day"><%= select_day(nil, :prefix =>
"product_return[exchange_date(3i)]", :discard_type => true,
:include_blank => true) %></div>

As is, the list will (obviously) always default to the blank selection,
but I am hoping for some type of if where if the exchange_date is nil
then nil is "used" (as above) and if exchange_date is not níl (there
is a date in the db), then is used.

Any help/ideas would be very much appreciated. If I have missed
something really obvious, I apologize.

-Fredrik Bach
This topic is locked and can not be replied to.