Skip to content

Instantly share code, notes, and snippets.

@johanb
Created April 6, 2011 21:16
Show Gist options
  • Save johanb/906544 to your computer and use it in GitHub Desktop.
Save johanb/906544 to your computer and use it in GitHub Desktop.
module LinksModule
def self.included(klass)
klass.class_eval do
before_filter :get_links
def get_links
@links = Link.order('position ASC').limit(5)
end
end
end
end
ActionController::Base.send(:include, LinksModule)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment