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 <[email protected]>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 <[email protected]>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<http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#ruby_blocks>explains
>>  how to run Ruby code in Haml.
>>
>> On Tue, Nov 9, 2010 at 8:59 AM, Zhi-Qiang Lei <[email protected]>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
>>> [email protected]
>>>
>>> --
>>> 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] <haml%[email protected]>.
>>> 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 [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.
>>
>>
>>
>> Best regards,
>> Zhi-Qiang Lei
>> [email protected]
>>
>>
>> --
>> 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] <haml%[email protected]>.
>> 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 [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.
>
>
>
> Best regards,
> Zhi-Qiang Lei
> [email protected]
>
>  --
> 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] <haml%[email protected]>.
> 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 [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.

Reply via email to