Skip to content

Instantly share code, notes, and snippets.

View th1988's full-sized avatar
πŸ§‘β€πŸ’»
Working on finanzfluss.de

Thomas Himbert th1988

πŸ§‘β€πŸ’»
Working on finanzfluss.de
  • finanzfluss.de
  • Berlin, Germany
View GitHub Profile
@asciant
asciant / angular.md
Last active October 30, 2015 20:11
Angular Rails 4.2

Rails 4.2 environment with AngularJS and Foundation 5

New rails project
rails new my_app -T -d postgresql
Update the Gemfile

Add:

@yesmeck
yesmeck / role_constraint.rb
Created October 19, 2013 19:21
Rails 4 user role constraint
# app/constraints/role_constraint.rb
class RoleConstraint
def initialize(*roles)
@roles = roles.map { |r| r.to_s }
end
def matches?(request)
@roles.include? request.env['warden'].user(:user).try(:role)
end
end