background preloader

Top 50 Ruby on Rails Websites

Top 50 Ruby on Rails Websites

seejohnrun/database_validation - GitHub Twitter on Scala Twitter on ScalaA Conversation with Steve Jenson, Alex Payne, and Robey Pointerby Bill VennersApril 3, 2009 Summary Three Twitter developers, Steve Jenson, Alex Payne, and Robey Pointer, talk with Bill Venners about their use of Scala in production at Twitter. Twitter is a fast growing website that provides a micro-blogging service. It began its life as a Ruby on Rails application, and still uses Ruby on Rails to deliver most user-facing web pages. But about a year ago they started replacing some of the back-end Ruby services with applications running on the JVM and written in Scala. In this interview, three developers from Twitter—Steve Jenson, system engineer; Alex Payne, API lead; and Robey Pointer, member of the service team—sit down with Bill Venners to discuss Twitter's real-world use of Scala. A quick look at Twitter Bill Venners: What is Twitter, and what in its technical history led you to consider Scala? Reliable, high performance code Complementing Ruby with Scala

Understanding Ruby and Rails: Lazy load hooks – Simone Carletti's Blog This article targets Rails 3 The article was written as of Rails 3.2. The information contained in this page might not apply to different versions. This is article is part of my series Understanding Ruby and Rails. A small-but-interesting feature introduced in Rails 3 is the built-in support for lazy loading. Lazy loading is a very common design pattern. With Rails 3 you can now register specific hooks to be lazy-executed when the corresponding library is loaded. class ApplicationController < ActionController::Base initializer "active_record.include_plugins" do ActiveSupport.on_load(:active_record) do include MyApp::ActivePlugins end end end In this case we register the block to be executed when the ActiveRecord library is loaded. ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) This line of code executes all the hooks previously registered for ActiveRecord. lazy-load hooks in the wild Perhaps one of the most frequent usage of the lazy-load hooks is in Rails plugins.

sandrods&#039;s odf-report at master - GitHub Hey, Don’t Dump. Debug! Are the "Two Ps" (print statements and prayer) all that comprise your debugging strategy? It's time you were introduced to the Interactive Ruby Debugger. I often ask other developers for advice. At times, the counsel reinforces my approach; at other times, the guidance challenges my thinking, leading me to refine my code or even pursue a wholly different solution. Out of curiosity, I also ask other coders about debugging techniques, and more often than not, I am surprised by the answer. In my Rails work, I use the debugger extensively. Installing the Debugger The debugger, ruby-debug , is provided as a Ruby gem and installs just as easily as any other extension. $ sudo gem install ruby-debug Once installed, you can invoke the debugger anywhere in your code with a call to debugger . class ExampleController < ApplicationController def index # ... debugger # ... end end $ ruby . Once the debugger is enabled, each call to debugger generates a command prompt. Commands to Query State ...

dcrec1&#039;s inploy at master - GitHub Simple APIs using SerializeWithOptions | Viget Extend While we were creating the SpeakerRate API, we noticed that ActiveRecord’s serialization system, while expressive, requires entirely too much repetition. As an example, keeping a speaker’s email address out of an API response is simple enough: @speaker.to_xml(:except => :email) But if we want to include speaker information in a talk response, we have to exclude the email attribute again: Then imagine that a talk has a set of additional directives, and the API responses for events and series include lists of talks, and you can see how our implementation quickly turned into dozens of lines of repetitive code strewn across several controllers. At its core, SerializeWithOptions is a simple DSL for describing how to turn an ActiveRecord object into XML or JSON. With this configuration in place, calling @speaker.to_xml is the same as calling: Once you’ve defined your serialization options, your controllers will end up looking like this:

Related: