Skip to content

Instantly share code, notes, and snippets.

🤖
Beep Boop

Adrian Rangel acrogenesis

🤖
Beep Boop
View GitHub Profile
@acrogenesis
acrogenesis / application_helper.rb
Last active Jan 2, 2016
Railscasts Search, Sort, Paginate, AJAX with Bootstrap 2
View application_helper.rb
module ApplicationHelper
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 (css_class ? title + direction_icon(direction) : title).html_safe, params.merge(:sort => column, :direction => direction, :page => nil), {:class => css_class}
end
private
@acrogenesis
acrogenesis / Dropbox Duplicates
Created Dec 21, 2013
Remove Dropbox Duplicates
View Dropbox Duplicates
find -L ~/Dropbox -name "*conflicted copy*" -exec rm {} \;
View foundation_will_paginate
module ApplicationHelper
class FoundationLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag(:ul, html, container_attributes)
end
def page_number(page)
tag :li, link(page, page, :rel => rel_value(page)), :class => ('current' if page == current_page)
You can’t perform that action at this time.