Showing posts with label rails 3. Show all posts
Showing posts with label rails 3. Show all posts

Tuesday, November 1, 2011

Wednesday, March 23, 2011

The Lowdown on Routes in Rails 3

In this post, we’ll walk through the underpinnings of Routes in Rails 3. They’ve been rewritten—for good reason—and after we get through the explanation

http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/

Tuesday, February 22, 2011

vestal_versions for Rails 3

acts_as_versioned by technoweenie was a great start, but it failed to keep up with ActiveRecord’s introduction of dirty objects in version 2.1. Additionally, each versioned model needs its own versions table that duplicates most of the original table’s columns. The versions table is then populated with records that often duplicate most of the original record’s attributes. All in all, not very DRY.
vestal_versions requires only one versions table (polymorphically associated with its parent models) and no changes whatsoever to existing tables. But it goes one step DRYer by storing a serialized hash of only the models’ changes. Think modern version control systems. By traversing the record of changes, the models can be reverted to any point in time.

Wednesday, February 2, 2011

NestedSet

Nested Set is an implementation of the nested set pattern for ActiveRecord models. It is replacement for acts_as_nested_set and BetterNestedSet, but awesomer. It supports Rails 3.0 and later.

https://github.com/skyeagle/nested_set

Sunday, October 3, 2010

SlowGrowl

Rails 3 plugin which surfaces slow code paths in your Rails application by integrating with the new Notifications API in Rails 3 with your system Growl (OSX) or libnotify (Linux) notification service. By default, any activity which takes longer than one second, will generate a growl alert, with the description of the action, time taken, and other meta data. A preview in action:
slowgrowl notification

http://github.com/igrigorik/slowgrowl

Saturday, September 11, 2010

Rails 3 Doesn't Autoload Modules In Lib

Rails 3 doesn’t autoload modules/code in lib by default. To fix it add the following code to your config/application.rb.
config.autoload_paths += %W(#{config.root}/lib)

Monday, August 30, 2010

Rails 3.0 Released (And 22 Free Videos To Bring You Up To Speed)

Rails 3.0 has been underway for a good two years, so it’s with immense pleasure that we can declare it’s finally here. We’ve brought the work of more than 1,600 contributors together to make everything better, faster, cleaner, and more beautiful.
David Heinemeier Hansson

DHH rings the bell and announces that Rails 3.0 (final) has been released after two years of determined effort by the Rails core team (and, significantly, Merb team members, since Rails 3.0 is heavily influenced by the Merb merger). Grab it now with gem install rails --version 3.0.0 or, if you're in no rush, Rails 3.0.1 might come along within a week or two.

The Videos

DHH gives a quick roundup of some of Rails 3's new features but like Emma Watson's head PhotoShopped onto yet another naked body, it's nothing you haven't seen before. If you're really fresh to Rails 3.0, though, Gregg does an admirable job of boiling everything down into a digestible format with his (free!) Dive Into Rails 3.0 screencast series:
Ryan Bates has also produced a fistful of his typically succinct but precise RailsCasts videos on a wide array of Rails 3.0 topics. Ryan always focuses on code and practicalities so these are a good place to start if you want to follow along and do some coding yourself:
If you don't like videos, still follow the links, because there are links to the ASCIIcasts regular HTML versions of the Railscasts videos. These are regular blog posts that you can follow at your own pace.

Or some books

Michael Hartl's Rails Tutorial book is the #1 (and only, in my opinion) place to start when it comes to books about learning Rails 3.0. Not only is it available to read for free online, but you can buy a well formatted PDF too. It's an amazing piece of work and, unusually, walks you through building a Rails app from start to finish with testing. If you want to just read one book/site and feel like a Rails 3.0 master by the end of it, pick RailsTutorial.org.
If you speak German, though, check out this "Ruby on Rails 3" book by Michael Voigt and Stefan Tennigkeit. It's one of the first Rails 3.0 specific books to hit the presses.

Or just dive into some code

If you want to just "get started" and check out a working Rails 3.0 application, try Daniel Kehoe's Rails3-Subdomain-Devise app. It's a basic Rails 3.0 app that demonstrates using the Devise authentication system, as well as custom subdomain access. Not just that, but Daniel has put together a walkthrough of how the app works and how it was put together.

http://www.rubyinside.com/rails-3-0-released-and-22-free-videos-to-bring-you-up-to-speed-3733.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+RubyInside+%28Ruby+Inside%29

Sunday, June 20, 2010

Custom Subdomains in Rails 3

Rails 3 supports subdomains out of the box, which is great. But did you know that the constraints in the Router can actually match patterns too? This means instead of hardcoding each subdomain into your routes you can allow your customers to decide their own subdomains.
However, we have to be careful with pattern matching on the subdomain. There are obvious subdomains we don’t want to match. Like ‘www’, ”, nil, and others that we may reserve. In this case using a pattern match might not be best.

http://bcardarella.com/post/716951242/custom-subdomains-in-rails-3

Wednesday, March 3, 2010

Rails 3

Yehuda Katz explains Rails 3: the performance improvements, the new architecture, the influence of Merb, and much more. Also: a look at the Bundler tool.

http://www.infoq.com/presentations/katz-rails3