That is a good answer to my question. If there is any better way to do this, 
please let me know. Thank you.

On Nov 10, 2010, at 1:33 PM, Nathan Weizenbaum wrote:

> If "myhash" is a Ruby variable, you can make it the hash of a Haml attribute 
> like so: %tag{myhash}
> 
> On Tue, Nov 9, 2010 at 9:23 PM, Zhi-Qiang Lei <zhiqiang....@gmail.com> wrote:
> No, in my original thoughts, it can be implement as follow:
> 1. Construct a hash with params (if pending in params is checked then make it 
> checked).
> 2. Make this hash to be the attributes of input element in haml.
> 
> Is this feasible? Thanks.
> 
> On Nov 10, 2010, at 1:13 PM, Nathan Weizenbaum wrote:
> 
>> Do you mean you want to put the parameters hash directly into the attributes 
>> hash of the input?
>> 
>> On Tue, Nov 9, 2010 at 7:59 PM, Zhi-Qiang Lei <zhiqiang....@gmail.com> wrote:
>> I had read the reference. But the idea still puzzles me. If I store the 
>> custom hash in a variable, how do I make the variable to be the attributes 
>> of input element?
>> 
>> On Nov 10, 2010, at 3:00 AM, Nathan Weizenbaum wrote:
>> 
>>> The reference explains how to run Ruby code in Haml.
>>> 
>>> On Tue, Nov 9, 2010 at 8:59 AM, Zhi-Qiang Lei <zhiqiang....@gmail.com> 
>>> wrote:
>>> Dear All,
>>> 
>>> I have a input element in my application.
>>> 
>>> %input#pending{:type => 'checkbox', :name => 'status[]', :value => 
>>> 'pending', :checked => 'checked'}
>>> 
>>> I want to control it with params. The aim is to display it only if params 
>>> contain the relative  value. How do I do this in haml? Thanks in advance.
>>> 
>>> Best regards,
>>> Zhi-Qiang Lei
>>> zhiqiang....@gmail.com
>>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Haml" group.
>>> To post to this group, send email to h...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> haml+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/haml?hl=en.
>>> 
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Haml" group.
>>> To post to this group, send email to h...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> haml+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/haml?hl=en.
>> 
>> 
>> 
>> Best regards,
>> Zhi-Qiang Lei
>> zhiqiang....@gmail.com
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Haml" group.
>> To post to this group, send email to h...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> haml+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/haml?hl=en.
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Haml" group.
>> To post to this group, send email to h...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> haml+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/haml?hl=en.
> 
> 
> Best regards,
> Zhi-Qiang Lei
> zhiqiang....@gmail.com
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Haml" group.
> To post to this group, send email to h...@googlegroups.com.
> To unsubscribe from this group, send email to 
> haml+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/haml?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Haml" group.
> To post to this group, send email to h...@googlegroups.com.
> To unsubscribe from this group, send email to 
> haml+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/haml?hl=en.


Best regards,
Zhi-Qiang Lei
zhiqiang....@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to