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
<%= image_tag(gravatar_url_for(comment.email)) %> |
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
def find_by_date | |
@posts = Post.find(:all, | |
:conditions => ["monthname(created_at) = ? AND year(created_at) = ?", | |
params[:month], params[:year]]) | |
render :action => "index" | |
end |
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
rep_gen = ReportGenerator.new | |
my_reports = [XmlReport.new, TextReport.new, HtmlReport.new, PdfReport.new] | |
my_reports.each do |report| | |
rep_gen.print_report(report) | |
end |
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
<div class="span-6"></div> |
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 PeopleController < ApplicationController | |
caches_page :index | |
end |
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
def create | |
expire_page :action => :index | |
end | |
def update | |
expire_page :action => :index | |
end |
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 PeopleController < ApplicationController | |
cache_sweeper :person_sweeper, :only => [:create, :update, :destroy] ... | |
end |
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 FullTimeEmployee < Employee | |
end | |
temp_employee.rb | |
class TempEmployee < Employee | |
end | |
student_employee.rb |
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
development: | |
adapter: mysql | |
encoding: utf8 | |
reconnect: false | |
database: dablog_development | |
pool: 5 | |
username: root | |
password: | |
host: localhost |
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 PersonSweeper < ActionController::Caching::Sweeper | |
observe Person | |
def after_create(person) | |
expire_cache_for person | |
end | |
def after_update(person) | |
expire_cache_for person | |
end |