Giter VIP home page Giter VIP logo

Comments (6)

supermarin avatar supermarin commented on June 10, 2024

Hm, the question is - how do we expect the URL to look like?

Let's say we are passing { types: [food, restaurant, shop] }
with your solution it generates:

localhost?types[]=food&types[]=restaurant&types[]=shop

The solution we have right now generates

localhost?types=[food, restaurant, shop]

However, the Google Places API separates by Pipe symbol (value1|value2|value3)

localhost?types=food|restaurant|shop

The fourth option is to use CSV

localhost?types=food,restaurant,shop

from bubblewrap.

mattetti avatar mattetti commented on June 10, 2024

The way Rails (and other frameworks) encode and expect the params is compatible with @tzusman patch:

>> { :types => ['food', 'restaurant', 'shop'] }.to_params
=> "types[]=food&types[]=restaurant&types[]=shop"

And that should also be true for POST params.
Maybe we can provide a wrapper method that takes an argument to pick the encoding style (rails, pipe, csv) with rails being the default?

from bubblewrap.

mattetti avatar mattetti commented on June 10, 2024

@mneorr as per our discussion, let's use the Rails default for 1.0 and add support for more encodings later on.
This is the last ticket before we push 1.0! \0/

from bubblewrap.

supermarin avatar supermarin commented on June 10, 2024

Sure, I'll amend the spec now and add the new behavior.

from bubblewrap.

tzusman avatar tzusman commented on June 10, 2024

The proposed solution would work great. Thanks for looking into this, and for building BubbleWrap!

from bubblewrap.

supermarin avatar supermarin commented on June 10, 2024

Added, tested ;)

Thanks @tzusman

from bubblewrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.