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

fix bug in sort_link helper around argument extraction about sort fields with block. #818

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

smoriwaki
Copy link
Contributor

fix bug in sort_link helper around argument extraction about sort fields with block.

@scarroll32
Copy link
Member

Hi @smoriwaki thank you for the PR.

Is it possible to provide more detail around the underlying issue, as well as a failing and then passing test? Thanks!

@smoriwaki
Copy link
Contributor Author

This pull request fix the bug in sort_link, which causes the multiple fields option to be ignored when block parameter is specified. For example in the following case,

<%= sort_link(@q, :last_name, %i(last_name first_name), default_order: {last_name: 'asc', first_name: 'desc'}) do %>
  Full Name
<% end %>

the following result is expected,

<a class="sort_link " href="/some_resources?q%5Bs%5D%5B%5D=first_name+asc&amp;q%5Bs%5D%5B%5D=last_name+asc">Full Name</a>

but, actually the following result is got.

<a class="sort_link " href="/some_resources?q%5Bs%5D=last_name+asc">Full Name</a>

@scarroll32 scarroll32 merged commit a916544 into activerecord-hackery:master Sep 14, 2017
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

Successfully merging this pull request may close these issues.

2 participants