Skip to content

Instantly share code, notes, and snippets.

@mikepack
mikepack / simple_paperclip.rb
Created July 26, 2013 19:36 — forked from basgys/simple_paperclip.rb
Convert to mixin
# == Paperclip without ActiveRecord
#
# Original: https://gist.github.com/basgys/5712426
require 'active_model/naming'
require 'active_model/callbacks'
require 'active_model/validations'
require 'paperclip'
require 'paperclip/glue'
@mikepack
mikepack / dci-rest-creation.rb
Created January 26, 2012 20:50 — forked from justinwiley/dci-rest-creation.rb
DCI + Rails new and create
# ---role
module BookManager
def create_book(attrs)
self.books.create! attrs
end
def update_book(book_id,attrs)
book = self.books.find(book_id)
book.update_attributes attrs