Re: [haml] Newbie question - Sinatra, Haml, Select form

1,145 views
Skip to first unread message

Matt Wildig

unread,
Jul 10, 2012, 2:20:06 PM7/10/12
to ha...@googlegroups.com
I think you're just missing a `name` attribute on your select, instead of or in addition to the id.

On 10 Jul 2012, at 01:12, Unix Guru wrote:
>
> @@ select
>
> %form{:action => "/select", :method => 'post'}
> %select#params
> - ['one', 'two', 'three'].each do |i|
> %option{:value => i}= i
> %input(type='submit')

I'd suggest using a name other than `params` too, as this clashes with the name of the Sinatra method:

%form{:action => "/select", :method => 'post'}
%select#my-select{:name => 'my-select'}
...

Also, watch out for your formatting. It might just be getting mangled in the email, but you need to consistently use the same about of indentation (you sometimes use one space, sometimes two), and the `%input` tag should be at the same level as the `%select`.


Matt

Unix Guru

unread,
Jul 10, 2012, 5:36:25 PM7/10/12
to ha...@googlegroups.com
Thanks Matt.   That did the trick.
Reply all
Reply to author
Forward
0 new messages