Hi there,
I need to set SELECTED inside <option> tag.
My haml code is:
//Just for validation purpose
= @page.reference
%select{:name => "reference"}
%option{ :selected => @page.reference ? "Google" : nil}Google
%option{ :selected => @page.reference ? "Yahoo!" : nil}Yahoo!
%option{ :selected => @page.reference ? "MSN" : nil}MSN
%option{ :selected => @page.reference ? "Ask" : nil}Ask
//For validation
= @page.reference
Actually the @page.reference == "Yahoo!" . But the code i get is
slightly different then I axpect
Yahoo!
<select name="reference">
<option selected="Google">Google</option>
<option selected="Yahoo!">Yahoo!</option>
<option selected="MSN">MSN</option>
<option selected="Ask">Ask</option>
</select>
Yahoo!
Could anybody describe me closer conditional statement setting right
selected option ?
Cheers.
P
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---