This file contains 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
# Patch Paperclip reprocess! and to_file methods to use binary mode (for Windows compatibility) | |
# Fixup content type on assignment | |
# Ensure the :original style is always processed first | |
module Paperclip | |
module Storage | |
module Filesystem | |
def to_file style = default_style | |
@queued_for_write[style] || (File.new(path(style), 'rb') if exists?(style)) | |
end | |
alias_method :to_io, :to_file |
This file contains 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
class ImageModelsController < ApplicationController | |
before_filter :find_image_model, :only => [:update] | |
def update | |
if @image_model.update_attributes(params[:image_model]) | |
@image_model.image.reprocess! | |
end | |
end | |
protected |
This file contains 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
# Patch Paperclip reprocess! and to_file methods to use binary mode (for Windows compatibility) | |
# Fixup content type on assignment | |
# Ensure the :original style is always processed first | |
module Paperclip | |
module Storage | |
module Filesystem | |
def to_file style = default_style | |
@queued_for_write[style] || (File.new(path(style), 'rb') if exists?(style)) | |
end | |
alias_method :to_io, :to_file |
This file contains 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
# 1. Create dirs for unpacking your source code and installing your apps | |
mkdir $HOME/src | |
mkdir $HOME/apps | |
# 2. Install the latest version of git | |
cd $HOME/src | |
wget http://kernel.org/pub/software/scm/git/git-1.6.2.tar.gz | |
tar zxvf git-1.6.2.tar.gz | |
cd git-1.6.2 | |
./configure --prefix=$HOME/apps NO_MMAP=1 |
This file contains 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
# App Template | |
# By Matt Polito | |
# Link to local copy of edge rails | |
rake('rails:freeze:gems') | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
This file contains 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
class PagesController < ApplicationController | |
before_filter :login_required, :except => [ :show ] | |
# GET /pages | |
# GET /pages.xml | |
def index | |
@pages = Page.find(:all) | |
respond_to do |format| | |
format.html # index.html.erb |
NewerOlder