Created
December 12, 2013 03:28
-
-
Save SamSamskies/7922779 to your computer and use it in GitHub Desktop.
Load vars to be used in layout using Rails.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_filter :load_vars | |
protected | |
def load_vars | |
#check if ajax call | |
unless request.xhr? | |
@future_events = Event.future_events.limit(15) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment