Hey
This was fairly simple so I'll just reply to myself. I gave up on a
custom sort. The regular sort is good enough and better-behaved than
something that works from the current date.
This all falls in the admin helper.
$ cat app/helpers/admin_helper.rb
module AdminHelper
def birthday_form_column(record, input_name)
date_select :record, :birthday, :discard_year =>
true, :include_blank => true
end
def birthday_column(record)
record.birthday ? "#{record.birthday.month}/
#{record.birthday.day}" : ""
end
end
Brad
On Sep 20, 10:18 pm, "Brad Midgley" <[EMAIL PROTECTED]> wrote:
> Hey
>
> What is the best way to get a "birthday" date picker?
>
> - It would not show year or time in picker
> - if date value is null, don't default to saving today's date in the
> field--leave it null
> - sorting by this field would ideally show you records in the order
> that birthdays are coming up
>
> --
> Brad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---