Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support jQuery-style parameter arrays #76

Closed
dark-panda opened this issue May 28, 2013 · 2 comments
Closed

Support jQuery-style parameter arrays #76

dark-panda opened this issue May 28, 2013 · 2 comments

Comments

@dark-panda
Copy link
Contributor

jQuery's $.param function supports parameter arrays created by .serializeArray as shown here:

http://api.jquery.com/serializeArray/

[
  {
    name: "a",
    value: "1"
  },
  {
    name: "b",
    value: "2"
  },
  {
    name: "c",
    value: "3"
  },
  {
    name: "d",
    value: "4"
  },
  {
    name: "e",
    value: "5"
  }
]

Running this through $.param creates the following:

"a=1&b=2&c=3&d=4&e=5"

JsRoutes currently raises the following exception when trying a similar array:

Error: Url parameters should be a javascript hash

It would be nice if JsRoutes could support this style of parameter array. JavaScript hashes aren't ordered, hence the serialized array that jQuery provides, which does provide a specific order.

@bogdan
Copy link
Collaborator

bogdan commented Aug 2, 2013

We can support this. I will gladly accept the PR.

@le0pard
Copy link
Member

le0pard commented Aug 30, 2015

Solved by #155

@le0pard le0pard closed this as completed Aug 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants