laurent25 Report post Posted June 20, 2011 Hello, I'm using RoR so I have posted my issue in the RoR forum but since i got no answers the last couple of days I'm trying my luck here. Here is my original post: I'm trying to put in place a server-side export my charts. Here is what I did so far: - Copied fc_exporter_controller.rb, fc_exporter_img_controller.rb , fc_exporter_pdf_controller.rb controllers in Controllers/Fusioncharts/ - Copied error_handler.rb , error_messages.rb , generator.rb , properties.rb , save_helper.rb in Lib/fusioncharts/exporter/ - Copied error.html.erb into the Views folder I have set the following tag on my chart: :exportEnabled=>1, :exportAtClient => 0, :exportHandler=>"Fusioncharts/fc_exporter/index", :exportFormats=>"JPG", :exportaction=>"save" I have modified the @@SAVEPATH to "./public/export/" in the properties.rb file I have installed the gem rmagick Now when I try to export my chart, i got a "RoutingError (No route matches "/Fusioncharts/fc_exporter/index")" which seems there is no route for that action (By the way there is no mention of that in the Readme.txt) So I added a route => match 'Fusioncharts/fc_exporter/index' => 'fc_exporter#index' And then i got this error: "RoutingError (uninitialized constant FcExporterController)" Any clue on what I'm doing wrong? Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 20, 2011 Hi Can you please specify the version of Rails you are using? Thanks Srividya Sharma Share this post Link to post Share on other sites
laurent25 Report post Posted June 20, 2011 Hi Can you please specify the version of Rails you are using? Thanks Srividya Sharma I'm using Rails 3.0.3 Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 20, 2011 I'm using Rails 3.0.3 Hi Please try out the sample application posted here for Rails3 : http://forum.fusioncharts.com/topic/8111-fusioncharts-rails-3-sample-application/ Hope this helps. Srividya Sharma Share this post Link to post Share on other sites
laurent25 Report post Posted June 21, 2011 Hi Please try out the sample application posted here for Rails3 : http://forum.fusionc...le-application/ Hope this helps. Srividya Sharma Thanks for the link, I tried the sample and it works. Hopefully I will find what wrong in my application thank to that.. Share this post Link to post Share on other sites
Guest Angshu Report post Posted June 21, 2011 Hi, Thank you very much for your appreciation. Happy FusionCharting! Share this post Link to post Share on other sites
laurent25 Report post Posted June 21, 2011 Hi, Thank you very much for your appreciation. Happy FusionCharting! I still can't make it works The route I had setup was wrong, missed the folder fusioncharts I got this now: match 'fusioncharts/fc_exporter/index' => 'fusioncharts/fc_exporter#index' But i got a new error ActionController::RoutingError (uninitialized constant Fusioncharts::Exporter): lib/fusioncharts/exporter/error_handler.rb:8:in `<top (required)>' app/controllers/fusioncharts/fc_exporter_controller.rb:45:in `<class:FcExporterController>' app/controllers/fusioncharts/fc_exporter_controller.rb:44:in `<top (required)>' I feel like i miss another route. Any doc anywhere that explain which route I have to setup in RoR to make this works? Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 22, 2011 From what I understood, the sample is working but you are unable to make it work in your application. Is that right? Let me take a look at the routes and get back to you. Share this post Link to post Share on other sites
laurent25 Report post Posted June 22, 2011 From what I understood, the sample is working but you are unable to make it work in your application. Is that right? Let me take a look at the routes and get back to you. Yes the sample worked nicely except the multi export one but that for later As for my application I'm keep getting ActionController::RoutingError (uninitialized constant xxxxxxxxxxx) Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 22, 2011 Can you please try setting :exportHandler=>"/fusioncharts/fc_exporter/index" once and tell me if it is working? Share this post Link to post Share on other sites
laurent25 Report post Posted June 22, 2011 Can you please try setting :exportHandler=>"/fusioncharts/fc_exporter/index" once and tell me if it is working? I have tried with this route: match 'exportHandler' => "fusioncharts/fc_exporter/index" RoR didn't like match :exportHandler=>"/fusioncharts/fc_exporter/index" But i got the same thing ActionController::RoutingError (uninitialized constant Fusioncharts::Exporter): lib/fusioncharts/exporter/error_handler.rb:8:in `<top (required)>' app/controllers/fusioncharts/fc_exporter_controller.rb:45:in `<class:FcExporterController>' app/controllers/fusioncharts/fc_exporter_controller.rb:44:in `<top (required)>' This is driving me crazy Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 22, 2011 Just to confirm, did you take the controller and other export related files from the Rails 3 sample? Share this post Link to post Share on other sites
laurent25 Report post Posted June 22, 2011 Just to confirm, did you take the controller and other export related files from the Rails 3 sample? I have tried with files from the FusionCharts_Evaluation (My compagny have licences but all they gave me was the fusioncharts JS and the swf files since they are working in PhP) And I have tried with the files from the sample. Share this post Link to post Share on other sites
srividya_sharma Report post Posted June 23, 2011 Would it be possible for you to send me a scaled-down version of your application? Share this post Link to post Share on other sites
laurent25 Report post Posted June 23, 2011 Would it be possible for you to send me a scaled-down version of your application? Yeah I could try to do a sample of my app this afternoon. Meanwhile i tried to do a simple case test with the render_chart helper. My app is in EXT JS so i don't use them. I did the same thing as the sample, I put the helpers in the libs folder and included FusionChartsHelper in application_helper.rb But of course me i get an error: ActionController::RoutingError (uninitialized constant ApplicationHelper::FusionChartsHelper) I have a very simple action : def test #Number of terminals by month data = [{:label => 'Dec', :value => 11589},{:label => 'Jan', :value => 12222},{:label => 'Feb', :value => 10000},{:label => 'Mar', :value => 8658},{:label => 'Apr', :value => 10500},{:label => 'May', :value => 11112}] @nbr_terminals = {"chart"=>{:exportEnabled=>1,:exportAtClient => 0,:exportHandler=>'/fusioncharts/fc_exporter/index',:exportFormats=>"JPG",:exportAction=>"save", "caption"=>"Number of terminals per month","setAdaptiveYMin"=>1,"showValues"=>0,"xaxisname"=>"Month","yaxisname"=>"Terminals","thousandSeparator"=>" ","formatNumberScale"=>0},:data => data} end and a basic view : <% #Create the chart - Column 3D Chart with data from /Data/SaveData.xml render_chart "/FusionCharts/Line2D.swf", "", @nbr_terminals, "myFirstExport", 600, 300, false, true, {:data_format=>"json"} %> Share this post Link to post Share on other sites
laurent25 Report post Posted June 23, 2011 Well by making a Sample of my app I found the issue. By default in a RoR app there are those two lines in the application.rb config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += Dir["#{config.root}/lib/**/"] For some reason there were missing from mine. Thanks for the help you have provided for the noob that i am Share this post Link to post Share on other sites
Guest Angshu Report post Posted June 23, 2011 Hi, You are always welcome. Glad to know that you have managed to resolve your issue. Happy FusionCharting! Share this post Link to post Share on other sites