Skip to content

Instantly share code, notes, and snippets.

View technicalpickles's full-sized avatar

Josh Nichols technicalpickles

View GitHub Profile
def update
@owner = Owner.find(current_user.id)
@owner.attributes= params[:owner]
if @owner.save
flash[:notice] = "Successfully updated your profile!"
current_user.reload
current_agent.reload
else
flash[:notice] = "Unable to update your profile!"
end
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize
class ApplicationController < ActionController::Base
protect_from_forgery
include Clearance::ApplicationController
end
create_table "posts", :force => true do |t|
t.string "title"
t.text "content"
t.datetime "published_at"
t.string "permalink"
t.text "cached_content_html"
end
@technicalpickles
technicalpickles / gist:15142
Created October 6, 2008 20:52
url_for fix for ActionView::TestCase
require 'action_view/test_case'
class ActionView::TestCase
include ActionController::UrlWriter
default_url_options[:host] = 'localhost'
end
(rdb:1) p @owner.first_name
"Jane1"
(rdb:1) @owner.update_attributes(:first_name => 'Bob')
true
(rdb:1) p @owner.first_name
"Jane1"
require 'rubygems'
require 'httparty'
module BOSS
class Options
cattr_accessor :appid
end
class Search
include HTTParty
base_uri 'http://boss.yahooapis.com'
%p Whoops! The resource you were looking for wasn't found.
class ApplicationController < ActionController::Base
include Clearance::ApplicationController
include SafetyValve::Controller
# ...
end
spec = Gem::Specification.new do |s|
s.name = "clearance"
s.summary = "Simple, complete Rails authentication."
s.email = "dcroak@thoughtbot.com"
s.homepage = "http://github.com/thoughtbot/clearance"
s.description = "Simple, complete Rails authentication scheme."
s.authors = ["thoughtbot, inc.", "Dan Croak", "Josh Nichols", "Mike Breen", "Mike Burns", "Jason Morrison"]
s.files = FileList["[A-Z]*", "{generators,lib,test}/**/*"]
end