Add README doc and fix CHANGELOG for PR #604 [skip ci]

Closes #633.
This commit is contained in:
Jon Atack 2016-01-02 23:58:18 +01:00
parent 4f8ed0a135
commit ceb136f252
2 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@
* Added optional block argument for the `sort_link` method. PR
[#604](https://github.com/activerecord-hackery/ransack/pull/604), commit
[2e6667b](https://github.com/dalpo/ransack/commit/2e6667b).
[997b856](https://github.com/dalpo/ransack/commit/997b856).
*Andrea Dal Ponte*

View File

@ -168,6 +168,14 @@ column title or a default sort order:
<%= sort_link(@q, :name, 'Last Name', default_order: :desc) %>
```
You can use a block if the link markup is hard to fit into the label parameter:
```erb
<%= sort_link(@q, :name) do %>
<strong>Player Name</strong>
<% end %>
```
With a polymorphic association, you may need to specify the name of the link
explicitly to avoid an `uninitialized constant Model::Xxxable` error (see issue
[#421](https://github.com/activerecord-hackery/ransack/issues/421)):
@ -775,4 +783,3 @@ directly related to bug reports, pull requests, or documentation improvements.
* Spread the word on Twitter, Facebook, and elsewhere if Ransack's been useful
to you. The more people who are using the project, the quicker we can find and
fix bugs!