Unfortunately Google Visualizations (like their attractive motion chart) expect the parameters to work with semicolons.
On Aug 17, 1:48 pm, "Ryan Bigg (Radar)" <[email protected]> wrote: > Is it possible to change that parameter to become > datasource?key1=value1&key2=value2? > > 2009/8/17 MarkBennett <[email protected]> > > > > > > > > > Hi everyone, > > > Thanks for the feedback that looks to be exactly what I was looking > > for. > > > I have uncovered a problem with the routing in my Rails 2.3.2 > > application though. Google got a bit smart and uses a parameter tqz > > to encode a set of colon-separated key:value pairs like this: > > >http://mysite.com/reports/1/datasource?tqz=key1:value1;key2:value2;ke... > > > Unfortunately the semi-colon is significant to the routing in this > > version of rails and it's seperating my parameters like this: > > > {"aciton"=>"datasource", "id"=>"1", "tqz"=>"key1:value1", > > "key2:value2" => nil, "key3:value3" => nil, "normalparam1" => > > "normalvalue1"} > > > What is the right way to fix this? > > > On Aug 17, 11:23 am, Nathan de Vries <[email protected]> wrote: > > > On 17/08/2009, at 10:45 AM, MarkBennett wrote: > > > > > What is the right way to do this in rails? What testing tools should > > > > I be using? > > > > There are plenty of testing frameworks you can layer on top of the > > > most basic tests, but in general terms you're going to be writing > > > integration tests. It will look a little something like this: > > > > > class SomeControllerTest < ActionController::IntegrationTest > > > > def test_response_has_correct_json_content_type > > > > get '/some/action.json' > > > > assert 'application/x-json', response.content_type > > > > end > > > > def test_response_conforms_to_google_vis_wire_protocol > > > > get '/some/action.json' > > > > # run some checks on response.body, perhaps > > > > # using JsonPath (XPath for JSON) > > > > end > > > > end > > > > If your SomeController#action does some smart stuff you don't really > > > need to test, you'll need to look into stubbing the methods your > > > action is calling by using a mocking/stubbing framework. Once you've > > > got your tests working, then you can start to look into other test > > > frameworks that provide a little bit of extra syntax-sugar/convenience. > > > > Hope that helps! > > > > Cheers, > > > > Nathan de Vries > > -- > Ryan Bigg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~----------~----~----~----~------~----~------~--~---
