parent
4f8ed0a135
commit
ceb136f252
|
@ -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*
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
Loading…
Reference in New Issue