Skip to content

Instantly share code, notes, and snippets.

@dbalatero
Created August 19, 2009 00:32
Show Gist options
  • Save dbalatero/170073 to your computer and use it in GitHub Desktop.
Save dbalatero/170073 to your computer and use it in GitHub Desktop.
class EventsController < ActionController::Base
layout 'events' # uses the layouts/events.html.erb file instead of the default layouts/application.html.erb
# This will fire the setup_global_data function before calling any controller action in this class.
before_filter :setup_global_data
def index
end
def calendar
end
private
def setup_global_data
# Grab the events so we can always render the calendar
@events = Event.find(:all) # or whatever...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment