我试图以各种方式执行我的粗略图表。 http://pullmonkey.com/projects/open_flash_chart2”rel=“nofollow”http://pullmonkey.com/projects/open_flash_chart2 我在我的肩上采取了步骤,但我只是给我自己的控制者增添了考验。 在我的道路上,我有过。
resources :my_controller_name do
collection do
get graph_code
end
end
also, since I don t think it could find the action my_controller_name/graph_code otherwise (I m kind of confused as to why most tutorials leave the routes part out? Am I doing something wrong?). (I also used @graph.html_safe in my views for Rails 3) Anyway when I go to /my_controller_name, I get the error in the flash box:
Open Flash Chart
JSON Parse Error [Syntax Error]
Error at character 0, line 1:
0: #<OpenFlashChart::OpenFlashChart:0x000001043c4b78
I don t know why this is happening. I tried creating a new app and following the guide, generating a controller named test_it. It worked (provided I corrected the routing). I can t think of how my controller is any different than test_it, except I initially generated it using a rails scaffold (so it has all the MVC parts), whereas I only generated the test_it controller. (I ve also tried using/not using the json gem conflict fix, but it didn t make a difference--https://github.com/klochner/open_flash_chart/commit/00cf531387880af8c49ed5118737f0492b437f75) Thanks for any insight, I m stumped as to why it s easy to implement on a new app but I can t add it to mine... Thanks.