# Haml issue

**URL:** <https://www.ruby-forum.com/t/haml-issue/186571>\
**Category:** Rails\
**Created:** [April 9, 2010, 1:07am UTC](https://www.ruby-forum.com/t/haml-issue/186571 "2010-04-09T01:07:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 9, 2010, 1:07am UTC](https://www.ruby-forum.com/t/haml-issue/186571/1 "2010-04-09T01:07:33Z")

</div>

Anyone know what’s wrong with this haml that it’s not displaying a chart  
(= @chart)?

```
%table.body-layout
      %tr
        %td{:colspan => 2}
          .panel#students-chart
            %h3.header Students
            #pieChart.content
      - content_for :javascripts do
        = @chart
        %td
          .panel#activity-chart
            %h3.header Activity
            .content

```

Thanks for any reply.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 9, 2010, 1:36am UTC](https://www.ruby-forum.com/t/haml-issue/186571/2 "2010-04-09T01:36:58Z")

</div>

On Thu, Apr 8, 2010 at 8:07 PM, John M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ```
> = @chart
> %td
> .panel#activity-chart
> %h3.header Activity
> .content
> 
> ```
> 
> ## Thanks for any reply.

What kind of variable is @chart?

–  
Leonardo M…  
There’s no place like ~

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 9, 2010, 3:42pm UTC](https://www.ruby-forum.com/t/haml-issue/186571/3 "2010-04-09T15:42:08Z")

</div>

Leonardo M. wrote:

> On Thu, Apr 8, 2010 at 8:07 PM, John M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½= @chart  
> > ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½%td  
> > ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½.panel#activity-chart  
> > ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½%h3.header Activity  
> > ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½.content
> > 
> > ## Thanks for any reply.
> 
> What kind of variable is @chart?
> 
> –  
> Leonardo M…  
> There’s no place like ~

If I do this, it renders chart as text:

```
            %h3.header Students
      #chart-container
      - content_for :javascripts do
      = @chart
        %td

```

I had this problem before and it was related to indentation and haml.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 9, 2010, 3:51pm UTC](https://www.ruby-forum.com/t/haml-issue/186571/4 "2010-04-09T15:51:54Z")

</div>

On Fri, Apr 9, 2010 at 10:42 AM, John M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > –  
> > > If I do this, it renders chart as text:  
> > > Ok, and what do you have stored in @chart? I mean, what type should it  
> > > be?

> Â Â Â Â Â Â Â Â %h3.header Students  
> Â Â Â Â Â #chart-container  
> Â Â Â Â Â - content\_for :javascripts do  
> Â Â Â Â Â = @chart  
> Â Â Â Â Â Â %td
> 
> I had this problem before and it was related to indentation and haml.  
> Weird, haml is pretty strict with indentation, a mistake will raise a  
> complie exception. I’m pretty sure you’re not showing the data the way  
> you should

–  
Leonardo M…  
There’s no place like ~

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [April 9, 2010, 7:14pm UTC](https://www.ruby-forum.com/t/haml-issue/186571/5 "2010-04-09T19:14:40Z")

</div>

On Apr 9, 2010, at 6:50 AM, Leonardo M. wrote:

> > > >
> > 
> > I had this problem before and it was related to indentation and haml.  
> > Weird, haml is pretty strict with indentation, a mistake will raise a  
> > complie exception. I’m pretty sure you’re not showing the data the way  
> > you should

The question about what kind of variable @chart is will be crucial in  
getting you any help. Also, it appears you might have intended = @chart  
to be indented beneath the content\_for block, but it isn’t.

You might want to join the haml mailing list on Google G. for quick  
answers: [http://groups.google.com/group/haml?hl=en](http://groups.google.com/group/haml?hl=en)

HTH
