Public Gists by matharvard

Gravatar
Tue Jun 16 08:06:36 -0700 2009
1
2
3
class Avatar < ActiveRecord::Base
  has_attachment :storage => :file_system, :content_type => :image, :resize_to => '40x40'
  validates_as_attachment
Gravatar
Fri May 08 23:25:08 -0700 2009
1
2
3
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
  if instance.error_message.kind_of?(Array)
    %(#{html_tag}<span class="validation-error">&nbsp;
Gravatar
Wed Jan 07 16:40:01 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
Gravatar
Tue Aug 05 23:37:41 -0700 2008
1
2
3
<?php get_header(); ?>
 
<div id="content" class="narrowcolumn">
Gravatar
Thu Jul 24 01:13:02 -0700 2008
1
2
3
namespace :blog do
  desc "Creates the default user account."
  task(:create_default_user => :environment) do
Gravatar
Thu Jul 24 01:11:27 -0700 2008
1
2
<%= link_to 'Back', :back %>
# No referrer header set it will produce: <a href="javascript:history.back();">Back</a>
gist: 158 My blog examples.
Gravatar
Mon Jul 21 13:40:27 -0700 2008
1
2
3
def create
  @post = Post.new(params[:post])