Hello!
Being new to rails, those things are bound to happen : little
technical problem I have been struggling with.
I need to write a select for a field that can be NULL
If I write this line in the view, I dont have any empty line:
<p><label for="coloc_id">Coloc</label><br/>
<%= select("lease", "coloc_id",
Tennant.find(:all).collect {|t|
[ t.name, t.id ] }) %>
How can I get one?
Thanks!
Julien
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
add this { :include_blank => true }
or { :prompt => "your_prompt_text" }
Seb
On Apr 9, 2007, at 3:16 PM, von.gauthier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
wrote:
>
> Hello!
>
> Being new to rails, those things are bound to happen : little
> technical problem I have been struggling with.
>
> I need to write a select for a field that can be NULL
>
> If I write this line in the view, I dont have any empty line:
>
> <p><label
for="coloc_id">Coloc</label><br/>
> <%= select("lease", "coloc_id",
Tennant.find(:all).collect {|t|
> [ t.name, t.id ] }) %>
>
> How can I get one?
>
> Thanks!
>
>
> Julien
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
...and I knew that the anwser would be that simple! Thanks! On Apr 9, 9:44 am, Sébastien Gruhier <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> add this { :include_blank => true } > > or { :prompt => "your_prompt_text" } > Seb > > On Apr 9, 2007, at 3:16 PM, von.gauth...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > > > Hello! > > > Being new to rails, those things are bound to happen : little > > technical problem I have been struggling with. > > > I need to write a select for a field that can be NULL > > > If I write this line in the view, I dont have any empty line: > > > <p><label for="coloc_id">Coloc</label><br/> > > <%= select("lease", "coloc_id", Tennant.find(:all).collect {|t| > > [ t.name, t.id ] }) %> > > > How can I get one? > > > Thanks! > > > Julien--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---