Rails Plugins are constantly evolving. Some of the plugins featured in the book will doubtlessly change over time, and that’s a good thing! However, it also presents the possibility that some of the examples in the book may not work with newer versions of plugins found at the plugin authors’ sites.
If you wish to get the latest and greatest features, the authors’ sites and README files will always be the de facto source for the most up-to-date version of that plugin. However, for your convenience we’ve also archived the plugin versions used in the book. If you wish to use these versions, please see the Source Code & Downloads section of this website and/or download the working examples as shown in the book.
The following is a list of known errata for Practical Rails Plugins:
http://svn.pragprog.com/svn/Public/plugins/annotate_models to http://repo.pragprog.com/svn/Public/plugins/annotate_modelsapp/views/documents.new.html.erb on the caption for listing 3-16 should read app/views/documents/new.html.erb.ruby script/plugin install git://github.com/technoweenie/acts_as_versioned.git
The included Riff repository is no longer accessible; download riff from http://tfletcher.com/dev/rails-plugins instead. Listing 4-3 should have an extra end at the end of the listing.
ruby script/plugin install git://github.com/darthapo/comatose.git). We’ve tested it and it seems to work great!:rel => "lightbox[set]"ruby script/plugin install http://liquid-markup.googlecode.com/svn/trunk
On page 355, the first line should be <ul>, and not <li>.
On page 351, the following code:
"<a href='#{@user.profile_url}'>" <<
"<%=@user.profile_url%></a>"
should be:
"<a href='#{@user.url}'>" <<
"#{@user.url}</a>"#{Time.now.to_f.to_s#{rand(1024)} should look like #{Time.now.to_f.to_s}#{rand(1024)}. The revised code listing is as follows:
class Url < ActiveRecord::Base
validates_presence_of :url
validates_uniqueness_of :shortcode
after_validation :ensure_shortcode_exists
def ensure_shortcode_exists
if self.shortcode.nil?
until !self.shortcode.nil? && Url.find_by_shortcode(self.shortcode).nil?
self.shortcode = Digest::MD5.hexdigest("#{self.url}_" <<
"#{Time.now.to_f.to_s}#{rand(1024)}"
).to_i(16).to_s(32)
end
end
end
endFound an error in the book that isn’t in this list? Please contact us with the details of the problem so we can add it to this list. Please make sure to include the page number and a brief description of the problem. Thanks!