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
Sortable arrow/icon in all sort links #754
Comments
I think this could be a great optional feature, esp. if it allows passing an icon. |
Pull requests welcome |
Thanks. I will submit a PR. Would you like this feature to be turned on or off by default? I'm thinking about naming that character/icon "initial_arrow", "sortable_icon" or "sortable_indicator". What do you think? I can think of two ways to make this feature optional:
Which do you think its best? |
Just thinking about this again ... It is possible to add any markup already.
What about a version of the sort_link helper which more easily includes an icon. I think it is better to create a new helper and leave the existing one as-is. Font Awesome are pretty much the main open source font library, we could use something like sort_fa_icon_link and then pass the name of the Font Awesome icon. What do you think? |
I was thinking about something like the following in
Plus adding an option to allow customizing the "initial arrow" in the config and, of course, the corresponding tests. |
Hey! Was this submitted? I would love to use this feature! |
Hey @abali96. This was not yet submitted. @seanfcarroll, I had most of the code ready before we started discussing implementation details. If you still think the feature is useful and you're ok with it being implemented as I described in this comment, I can open a PR. If positive, your feedback about these design decisions would be valuable. |
@brunofacca sorry for the delay in responding. I'd vote for the config option
|
No problem @seanfcarroll. Unfortunately, I no longer have any free time to implement this. I suggest we close this issue and I will reopen it if/when the required time comes up. |
Closed. |
Inexperienced users may not realize that columns are sortable just because their header names contain links. I have monkey patched Ransack to include a bidirectional vertical arrow in all sort links to explicitly indicate that those columns are sortable. I'd like to open a pull request. Are you interested in adding this feature to Ransack?
The main change would be in Ransack::Helpers::FormHelper::SortLink
I have also modified Ransack::Configuration to allow customization of the bidirectional arrow.
The text was updated successfully, but these errors were encountered: