Skip to content

Instantly share code, notes, and snippets.

View tdouce's full-sized avatar

Travis Douce tdouce

View GitHub Profile
@tdouce
tdouce / gist:6193810
Last active December 20, 2015 20:58 — forked from jeremiaheb/gist:6186725
class DashboardController < ApplicationController
before_filter :authenticate_diver!
authorize_resource
def show
@divers = Dashboard.new.divers(current_diver)
end
end
class DashboardController < ApplicationController
before_filter :authenticate_diver!
authorize_resource
def show
if current_diver.role == 'admin'
@boat_logs = BoatLog.all
elsif current_diver.role == 'manager'
@boat_logs = BoatLog.where( "boatlog_manager_id=?", current_diver.boatlog_manager_id )