问题
I'm having trouble producing a traditional HTML dropdown box in HAML. I'm using the Yii HAML extension, so I'm sure if its a quirk with that specifically.
This is the HAML I'm using ...
%select
%option one
%option two
%option three
This is the HTML output I'm trying to get ...
<select>
<option>one</option>
<option>two</option>
<option>three</option>
</select>
回答1:
Your indent is off by one space. It's two spaces, not three.
%select
%option one
%option two
%option three
来源:https://stackoverflow.com/questions/7746870/select-list-dropdown-in-haml