Render error with Rails 2.3.2
#1
Posted 24 May 2009 - 03:25 PM
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
Other Replies To This Topic
#2
Posted 26 May 2009 - 06:46 PM
Any ideas about that?
Thanks
Other Replies To This Topic
#3
Posted 27 May 2009 - 04:11 AM
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.
Srividya Sharma
Other Replies To This Topic
#4
Posted 27 May 2009 - 10:31 AM
[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
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]
Other Replies To This Topic
#5
Posted 27 May 2009 - 01:41 PM
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.
Other Replies To This Topic
#6
Posted 27 May 2009 - 02:08 PM
looks like this works for me
render :file => "factories/basic_factories_quantity", :locals => {:factory_data => @factory_data}
Hope this helps.
Other Replies To This Topic
#7
Posted 27 May 2009 - 07:59 PM
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
Srividya Sharma
Other Replies To This Topic
#8
Posted 27 May 2009 - 09:51 PM
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)
-
RoRFreeVersionSampleAppForRails2.3.2.zip (251.35K)
Number of downloads: 97
Srividya Sharma

Back to top
MultiQuote
