I know I''ve seen the answer for this somewhere and now when needed I can''t find it. If I have a select list from a table but i want an option like "please select" as the default option to come up how would I add that in ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
bump ....anyone know the answer ? On 9/4/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I know I''ve seen the answer for this somewhere and now when needed I > can''t find it. > If I have a select list from a table but i want an option like "please > select" as the default option to come up how would I add that in ? >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<select name="myselect"> <option selected>Please Select</option> <option>1</option> <option>2</option> ... </select> Please remember in the future that this list is for questions specific to Rails, not HTML. On 04/09/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > bump ....anyone know the answer ? > > > On 9/4/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I know I''ve seen the answer for this somewhere and now when needed I > > can''t find it. > > If I have a select list from a table but i want an option like "please > > select" as the default option to come up how would I add that in ? > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It is Rails related. Currently I have collection_select(:table, method, :id :name) Within this I wanted to know if there was a specific way to add an option in addition to what I''m pulling out of the database. Stuart On 9/4/06, Ian Leitch <port001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <select name="myselect"> > <option selected>Please Select</option> > <option>1</option> > <option>2</option> > ... > </select> > > Please remember in the future that this list is for questions specific to > Rails, not HTML. > > > On 04/09/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > bump ....anyone know the answer ? > > > On 9/4/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I know I''ve seen the answer for this somewhere and now when needed I > > can''t find it. > > If I have a select list from a table but i want an option like "please > > select" as the default option to come up how would I add that in ? > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I am not sure if this answers your question but at: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M000404 For "options_for_select" and "collection_select" I found options ":include_blank" and ":selected". Dark Ambient wrote:> It is Rails related. > Currently I have collection_select(:table, method, :id :name) > Within this I wanted to know if there was a specific way to add an > option in addition to what I''m pulling out of the database. > > Stuart > > On 9/4/06, Ian Leitch <port001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > <select name="myselect"> > > <option selected>Please Select</option> > > <option>1</option> > > <option>2</option> > > ... > > </select> > > > > Please remember in the future that this list is for questions specific to > > Rails, not HTML. > > > > > > On 04/09/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > bump ....anyone know the answer ? > > > > > > On 9/4/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I know I''ve seen the answer for this somewhere and now when needed I > > > can''t find it. > > > If I have a select list from a table but i want an option like "please > > > select" as the default option to come up how would I add that in ? > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thomas, Mark - BLS CTR
2006-Sep-05 18:15 UTC
Re: Question: Select list and default options
On 9/4/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I know I''ve seen the answer for this somewhere and now > when needed I can''t find it. If I have a select list > from a table but i want an option like "please select" > as the default option to come up how would I add that > in ?Perhaps you are referring to AWDWR page 105? <% options = [["Select a payment option:", ""]] + Order::PAYMENT_TYPES select("order", "pay_type", options) %> - Mark. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---