Skip to content

Instantly share code, notes, and snippets.

@vinniefranco
Forked from typeoneerror/dynamic-paths.rb
Created November 22, 2011 19:02
Show Gist options
  • Save vinniefranco/1386561 to your computer and use it in GitHub Desktop.
Save vinniefranco/1386561 to your computer and use it in GitHub Desktop.
module AdminHelper
def link_to_direction(field)
title = field.humanize
dir = @order_dir == 'ASC' ? 'desc' : 'asc'
link_to title, yield(:order => field, :dir => dir) if block_given?
end
end
= link_to_direction('name') {|params| admin_artists_path(params)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment