Created
May 6, 2012 14:08
-
-
Save hmans/2622461 to your computer and use it in GitHub Desktop.
More work in progress...
This file contains hidden or 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
run Freddie do | |
layout 'application.html.haml' | |
# Serve some asset files | |
# | |
path('application-:timestamp.css') { stylesheet 'application.scss' } | |
path('application-:timestamp.js') { javascript 'application.js' } | |
# Built-in OmniAuth support | |
# | |
omni_auth | |
# Provide a /logout action | |
# | |
path('logout') do | |
session['omniauth_user'] = nil | |
redirect_to '/' | |
end | |
# Mount the Event model RESTfully. This adds all the required | |
# paths and even applies authorization scopes for the | |
# currently logged in user. | |
# | |
resource :events do | |
can :index, :show | |
can :new, :create, :update, :destroy if current_user.admin? | |
end | |
# The root action is a simple redirect. | |
# | |
redirect_to '/events' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment