All, Is there any built-in way in the "select" form helper to display something other than "Select" in the :include_blank option? Specifically, for a date helper, would like to show "Month", "Day", "Year" respectively for those options in 3 selects. Thanks, Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Try this:
script/generate scaffold Thing name:string when:datetime text:body
You''ll see:
In migration:
    create_table :things do |t|
      t.string :name
      t.datetime :when
      t.text :body
    end
In view:
<h1>New thing</h1>
<% form_for(@thing) do |f| %>
  <%= f.error_messages %>
.
.
  <p>
    <%= f.label :when %><br />
    <%= f.datetime_select :when %>
  </p>
start your server and check out: localhost:3000/things/new
On Feb 9, 10:06 am, Wes Gamble
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> All,
>
> Is there any built-in way in the "select" form helper to display
> something other than "Select" in the :include_blank option?
> Specifically, for a date helper, would like to show "Month",
"Day",
> "Year" respectively for those options in 3 selects.
>
> Thanks,
> Wes
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Wes Gamble
2009-Feb-09  23:02 UTC
Re: Option on select form helper to customize "Select" text?
Rick, Thanks, but not what I''m looking for. Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Feb-09  23:51 UTC
Re: Option on select form helper to customize "Select" text?
On Feb 9, 8:06 pm, Wes Gamble <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> All, > > Is there any built-in way in the "select" form helper to display > something other than "Select" in the :include_blank option? > Specifically, for a date helper, would like to show "Month", "Day", > "Year" respectively for those options in 3 selects. >If the :include_blank option is a string then that is used for the blank option. There''s also the :prompt option. I do recall that support of this with the date_select stuff was only added recently. Fred> Thanks, > Wes > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wes Gamble
2009-Feb-10  00:24 UTC
Re: Option on select form helper to customize "Select" text?
Fred, Thanks for the info. I neglected to mention that this is on Rails 1.2.6 (please no one "helpfully suggest" that I upgrade - thanks ;]), so these options are not available. It''s fine - I won''t die. One further question, if you use a "unified" helper like date_select in the current v. of Rails (obviously), can you set different promopts for each component input field of the date? Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---