Hi!

On 23 Dez., 20:53, "G. Sobrinho" <[email protected]> wrote:


> = link_to_unless_current('Contact', contact_index_path) do
>   = link_to 'Contact', contact_index_path, :class => 'active'
>
> But this create a unexpected "7" on the source. If i'm outside contact
> page this works fine. But if i'm on contact page (which will use the
> block) the rendered HTML render this:

I had the same question.
The solution is described here:
http://groups.google.com/group/haml/browse_thread/thread/52e62ef501c504a3

Unfortunatelly you have to write the whole method in one line and
escape the block with "" to make it readable.
    = link_to_unless_current 'Profile', user_url(current_user) do |
name| "<strong class='current'>#{name}</strong>" end

Regards
Tobias


--

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