For sorting implementation in ransack, refer to the following URL Let's make a search function with Ruby on Rails (ransack)
In the above image, the retweet number sort part
Change the default blue to black!
index.html.erb
<%= sort_link(@q, :tweet_created_at, "Post date and time" ,{ default_order: :desc }, { class: "Editlink" }) %>
application.scss
//Erase the link
.Editlink {
text-decoration: none;
color: #272343;
&:link {
text-decoration: none;
color: #272343;
}
&:visited {
text-decoration: none;
color: #272343;
}
&:hover {
text-decoration: none;
color: #272343;
}
&:active {
text-decoration: none;
color: #272343;
}
}
<% = sort_link (@q, column name to sort," characters to display in link ", {specify how to sort}, {Html option})%>
If you specify class and id in the html option part of this writing, you can customize sort_link as you like using css!
Recommended Posts