Skip to content

Instantly share code, notes, and snippets.

View pwanderson's full-sized avatar

Patrick Anderson pwanderson

View GitHub Profile
@pwanderson
pwanderson / ability.rb
Created November 4, 2011 23:55 — forked from watson/ability.rb
Active Admin CanCan integration with shared front/backend User model and multi-level autherization
# app/models/ability.rb
# All front end users are authorized using this class
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new
can :read, :all
@pwanderson
pwanderson / formtastic_extentions.rb
Created January 5, 2012 22:34 — forked from rhulse/formtastic_extentions.rb
Formtastic 2.0 custom input upgrade examples
# This file contains custom input method from formtastic 1.2 and their
# replacement classes in 2.0
module FormtasticExtensions
class WysiwygInput < Formtastic::Inputs::TextInput
def input_html_options
wysiwyg_type = input_options.delete(:controls)