RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: AlexandrBasan
Using FontAwesome as chevron
def sortable(column, title = nil) title ||= column.titleize css_class = column == sort_column ? "current #{sort_direction}" : nil direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc" link_to (("#{title} #{content_tag(:i, '', :class => "fa fa-chevron-#{direction == 'asc' ? 'up': 'down'}", :style => "font-size: 6px;") if css_class.present?}").html_safe), params.merge(:sort => column, :direction => direction, :page => nil), {:class => css_class} end
Thank you for your solution! Cropper.rb have class Cropper < Thumbnail so processors => [:cropper, :thumbnail]. This code works perfect.
Using FontAwesome as chevron
def sortable(column, title = nil)
title ||= column.titleize
css_class = column == sort_column ? "current #{sort_direction}" : nil
direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
link_to (("#{title} #{content_tag(:i, '', :class => "fa fa-chevron-#{direction == 'asc' ? 'up': 'down'}", :style => "font-size: 6px;") if css_class.present?}").html_safe), params.merge(:sort => column, :direction => direction, :page => nil), {:class => css_class}
end
Thank you for your solution!
Cropper.rb have class Cropper < Thumbnail
so
processors => [:cropper, :thumbnail].
This code works perfect.