Peter Cooper : UK Web 2.0 and Ruby on Rails consultant
Recent Posts
»Jay-Z: From Brooklyn to the Boardroom
»Prank Caller Submits Girl To Sexual Torture By Proxy
>Full archive
Other Posts
« I'm 2,500 times more efficientNo claims discount expiry »

Snippets 0.2


This post is obsolete. Snippets 0.3 has been released. This post is staying here for historical purposes only.

A new version of Snippets has hit the streets. It now has a fluid design, persistent login, comments, and other scrummy features. Still lots of work to be done, but it's nicely usable now. The source is also available for download here.

PLEASE NOTE THAT SNIPPETS 0.2 IS NOT RAILS 0.13 COMPATIBLE. Rails 0.13 has made some changes that bust Snippets.

You can make it compatible by downloading Snippets 0.21/fixes and unpacking it iin the app/controllers folder. It replaces application.rb and comments_controller.rb, and also provides a replacement routes.rb file you can copy to /config. It also fixes a bug with commenting.

Or if you already have 0.2 and want to patch by HAND...

1) Go into /config/routes.rb and change all integers to quoted.. so :rss => 1, becomes :rss => "1" .. this is due to Routes changing in 0.13.

2) Go into /app/controller/application.rb and find the redirect_back function.. make it look like so:

def redirect_back(default)
if @session['prevpage'].nil?
if default
redirect_to default
else
redirect_to :controller => "", :action => ""
end
else
redirect_to_url @session['prevpage']
end
end

Snippets 0.3 will have more than this, but these are the quick fixes to get it running on Rails 0.13.




May 21, 2005 | Posted by peter | Comments (2)
Comments

Thank you!!!! I am trying to build an application that uses tags, and I was having some SQL troubles. Snippets does something similar, so the source code helped big time. Nice work, by the way.

Posted by: Matt Moriarity at May 22, 2005 01:08 PM

Thanks for sharing the source. It's great to be able to look at the source of quality apps like Snippets and learn how Rails works.

Posted by: Jon at July 17, 2005 10:20 PM

Return to the homepage.
Privacy Policy