syntax error, unexpected '\n', expecting tASSOC

Hey all,

I get the following error. Now I know it's related to a curly brace, but
it seems that all curly braces are properly in place. So I'm not sure
why I get this error:

SyntaxError in DashboardController#panels

rails/app/controllers/dashboard_controller.rb:170: syntax error,
unexpected '\n', expecting tASSOC

def panels

      addDetailToContainer = "function() {
          var detailContainer = jQuery('#container').prepend(
              '<div id=\"details-chart\"></div>'
            ),
            detailStart = Date.UTC(2008, 7, 1),
            detailData = [];
            jQuery.each(this.series[0].data, function(i, point) {
              if (point.x > detailStart) {
                detailData.push(point.y);
              }
            });
            "

        pie_label_formatter = "
          function() {
            if (this.y > 15) return this.point.name;
          }"

        master_detail_tooltip_formatter = "
          function() {
            return '<b>'+ (this.point.name || this.series.name)
+'</b><br/>'+
              Highcharts.dateFormat('%A %B %e %Y', this.x) + ':<br/>'+
              '1 USD = '+ Highcharts.numberFormat(this.y, 2) +' EUR';
          }"

           @pie_chart =
            Highchart.line({
              :chart => {
                :renderTo => 'container',
                :zoomType => 'x',
                :margin => [330, 30, 30, 80],
                :events => {
                  :load => addDetailToContainer,
            Highchart.line({
              :chart => {
                :borderWidth => 0,
                :backgroundColor => '#000000',
                :renderTo => "details-chart",
                :height => 330,
                :margin => [80, 30, 20, 80],
                :style => {
                  :position => 'absolute'
                }
                  },
                  :credits => {
                    :enabled => false,
                    :href => '',
                    :text => 'Data provided by Verdacom'
                  },
                  :xAxis => {
                    :type => 'datetime'
                  },
                  :yAxis => {
                    :title => '',
                    :maxZoom => 0.1
                  },
                  :legend => {
                    :enabled => false
                  },
                  :plotOptions => {
                    :series => {
                      :marker => {
                        :enabled => false,
                        :states => {
                          :hover => {
                            :enabled => true,
                            :radius => 3
                          }
                        }
                      }
                    }
                  },
                :series => [
                      {
                        :name => 'USD to EUR',
                        :pointStart => detailStart,
                        :pointInterval => 24 * 3600 * 1000,
                        :data => detailData
                      }
                  ],
                  :subtitle => {
                    :text => 'Fiscal Year 2010'
                  },
                  :title => {
                    :text => 'Cumulative Subject State By Month'
                  },
                  :tooltip => {
                    :formatter => master_detail_tooltip_formatter
                  }
              })

    ]]

  end

Thanks for any response.

And line 170 is???

You could also try removing code until the error goes away. Then put it back and fix it.

This bit here (after addDetailToContainer ) isn't right.

Fred

Hey all,

I get the following error. Now I know it's related to a curly brace, but
it seems that all curly braces are properly in place. So I'm not sure
why I get this error:

SyntaxError in DashboardController#panels

rails/app/controllers/dashboard_controller.rb:170: syntax error,
unexpected '\n', expecting tASSOC

def panels
snip

]]

You seem to have rather more '[' than ']'

I think you need an editor that shows bracket matching.

Colin