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.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Apr-05 16:31 UTC
Re: syntax error, unexpected ''\n'', expecting tASSOC
And line 170 is??? You could also try removing code until the error goes away. Then put it back and fix it. On Apr 5, 2010, at 6:28 AM, John Merlino wrote:> 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. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Apr-05 16:36 UTC
Re: syntax error, unexpected ''\n'', expecting tASSOC
On Apr 5, 2:28 pm, John Merlino <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> @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'' > }This bit here (after addDetailToContainer ) isn''t right. Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2010 14:28, John Merlino <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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> > end > > Thanks for any response. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.