Thanks Carlos & Vasily
Ok now I see this hidden input w empty value ...
I guess it's a standard Rails output when using multiple .... ( found
similar questions on the web... about it)
but why ? and why it's not possible to get rid of it w an option .. ?
<div class="controls">
<input type="hidden" value="" name="project[local_contacts][]">
<select name="project[local_contacts][]" multiple="multiple"
id="project_local_contacts" class="select optional">
<option selected="selected" value="1">Mr Jean Bordeaux</option>
<option selected="selected" value="16">Mme User1 Client1</option>
</select>
</div>
On Apr 11, 1:47 pm, Carlos Antonio da Silva
<
carlosantoniodasi...@gmail.com> wrote:
> Ah great Vasiliy, I didn't remember that happens to select + multiple as well, thanks :D
>
> The hidden field might be before the select he posted, so the full html would help to check that.
>
> --
> At.
> Carlos Antonio
>
>
>
>
>
>
>
> On Wednesday, April 11, 2012 at 8:31 AM, Vasiliy Ermolovich wrote:
> > When you are using multiple select rails generates hidden input with blank value for you:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp...
> > But I don't see it in your generated html :\
>
> > 2012/4/11 Carlos Antonio da Silva <
carlosantoniodasi...@gmail.com (mailto:
carlosantoniodasi...@gmail.com)>
> > > The html select you've sent is the only output you get, or you have the entire input with wrapper? I can't see SimpleForm generating anything wrong with that, which makes me think that might be the browser sending an empty value or something.
>
> > > --
> > > At.
> > > Carlos Antonio
>
> > > On Wednesday, April 11, 2012 at 7:29 AM, erwin wrote:
>
> > > > just for info : tested with simple_form_bootstrap example, same
> > > > issue :
>
> > > > new article params
> > > > params
> > > > {"utf8"=>"✓",
> > > > "authenticity_token"=>"E4mnngwuKryEfEzc3O2H78tyiQizhWWY2cMx7dA0fHI=",
> > > > "article"=>{"name"=>"", "published"=>"0", "content_type_1"=>[""],
> > > > "content_type_3"=>["", "Blog", "Announce"], "category"=>"",
> > > > "content"=>""}, "commit"=>"Create Article", "action"=>"create",
> > > > "controller"=>"articles"}
>
> > > > we can see : "content_type_3"=>["", "Blog", "Announce"] 3 items
> > > > but only 2 selected in the list
>