This file contains hidden or 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
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 |
This file contains hidden or 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
# 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 |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
include Clearance::ApplicationController | |
end |
This file contains hidden or 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
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 |
This file contains hidden or 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
require 'action_view/test_case' | |
class ActionView::TestCase | |
include ActionController::UrlWriter | |
default_url_options[:host] = 'localhost' | |
end |
This file contains hidden or 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
(rdb:1) p @owner.first_name | |
"Jane1" | |
(rdb:1) @owner.update_attributes(:first_name => 'Bob') | |
true | |
(rdb:1) p @owner.first_name | |
"Jane1" |
This file contains hidden or 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
require 'rubygems' | |
require 'httparty' | |
module BOSS | |
class Options | |
cattr_accessor :appid | |
end | |
class Search | |
include HTTParty | |
base_uri 'http://boss.yahooapis.com' |
This file contains hidden or 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
%p Whoops! The resource you were looking for wasn't found. |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
include Clearance::ApplicationController | |
include SafetyValve::Controller | |
# ... | |
end |
This file contains hidden or 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
spec = Gem::Specification.new do |s| | |
s.name = "clearance" | |
s.summary = "Simple, complete Rails authentication." | |
s.email = "[email protected]" | |
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 | |