FusionCharts Forum: Render error with Rails 2.3.2 - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Render error with Rails 2.3.2

#1 User is offline   sakkew 

  • Forum Newbie
  • Group: Members
  • Posts: 1
  • Joined: 24-May 09

Posted 24 May 2009 - 03:25 PM

I cannot get the demos using dataXML to work if I use Rails v2.3.2. They work fine with 2.0.2.

It seems like the 'render'-method behaves differently from previous versions. The error from for example page "http://localhost:3000/fusioncharts/basic_example/data_xml" is: "Missing template fusioncharts/basic_example/_sampledata.erb in view path app/views". The error comes from line "str_xml = render "fusioncharts/basic_example/sampledata" in view app/views/fusioncharts/basic_example/data_xml.html.erb.



I've got the same problem with the demo "Simple Column 3D Chart with XML data hard-coded in the builder (dataXML method)".



The demos using dataURL works fine.





Best regards,

Sakke
0

Other Replies To This Topic

#2 User is offline   macsig 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 26-May 09

Posted 26 May 2009 - 06:46 PM

I got the same error.



Any ideas about that?





Thanks
Alla prossima ...
0

Other Replies To This Topic

#3 User is offline   srividya_sharma 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 943
  • Joined: 01-October 07

Posted 27 May 2009 - 04:11 AM

Hi

The FusionCharts RoR sample application was tested on rails 2.2.2. Rails 2.3 was released afterwards.

Yes, looks like the rails render function has changed.

So in the basic example, you need to give:

render '/fusioncharts/basic_example/sampledata'

Rails determines that this is a file render because of the leading slash character. To be explicit, you can use the :file option (which was required on Rails 2.2 and earlier)

If you’re running on Microsoft Windows, you should use the :file option to render a file, because Windows filenames do not have the same format as Unix filenames.

reference: http://guides.rubyonrails.org/layouts_and_rendering.html

Hopefully the next FusionCharts release will contain application compatible with 2.3.2 or higher. ( the latest version at the time of release )

I haven't tested it with 2.3.2 yet, will do so and get back to you with  more details.

Hope this helps. :)

regards,
Srividya Sharma
0

Other Replies To This Topic

#4 User is offline   asmuts 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 27-May 09

Posted 27 May 2009 - 10:31 AM

Hi Srividya

[p]I had the same problem and have not been able to solve it on the database examples. However I thought it would be good to mention that I got your "time tracker" application to work using

Quote

str_xml = render :file => ".... "




I noticed that in the database example it has the hash option after the string as follows

Quote


render :file => "factories/basic_factories_quantity", {:factory_data => @factory_data}



whereas in your "time tracker" application there is no hash option. Could this have something to do with it? Using "render :file =>" throws an error i.e. "syntax error, unexpected '', expecting tASSOC". Hope we can solve this soon as the fusion charts are great.



Many thanks

[/p]
0

Other Replies To This Topic

#5 User is offline   macsig 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 26-May 09

Posted 27 May 2009 - 01:41 PM

Hi all,

I can confirm that the issue looks to be related to the hash.

I could make to work an hybrid solution that renders an hardcoded builder.





Right now I'm looking into that and if I will figure anything out I will let you know.





Have a nice day.
Alla prossima ...
0

Other Replies To This Topic

#6 User is offline   macsig 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 26-May 09

Posted 27 May 2009 - 02:08 PM

Hi again,

looks like this works for me




 render :file => "factories/basic_factories_quantity", :locals => {:factory_data => @factory_data}







Hope this helps.
Alla prossima ...
0

Other Replies To This Topic

#7 User is offline   srividya_sharma 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 943
  • Joined: 01-October 07

Posted 27 May 2009 - 07:59 PM

Hi everybody,

The FusionCharts v3 RoR samples have been updated for Rails 2.3. The same has not been done with Free samples yet.

For basic_dbexample, this is the correct line as pointed out by macsig:

str_xml = render :file=>"fusioncharts/db_example/basic_factories_quantity",:locals=>{:factory_data => @factory_data}

Srividya

regards,
Srividya Sharma
0

Other Replies To This Topic

#8 User is offline   srividya_sharma 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 943
  • Joined: 01-October 07

Posted 27 May 2009 - 09:51 PM

Hi everybody,

I have tested the Free version RoR samples with 2.3.2.

The important changes are:

1. Rename application.rb to application_controller.rb

2. Use render :file=> instead of render

3. Provide the hash to the render function using :locals=>

4. Changes in the FusionCharts RoR library files ( in the concat function - to avoid deprecation warning )

Here is the modified application. Please place the FusionCharts folder in public folder before testing.

Hope this solves all the issues related to rails 2.3.2. :)

Srividya

Keep asking and keep getting more out of FusionCharts

Attached File(s)


regards,
Srividya Sharma
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic