The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Working with NSTableView
A look at how to implement a basic table view with column sorting (along with simple form fields to add data to the table) in a Mac OS X app created with RubyMotion
Use Capybara and Rspec to test non Rack app
I need to test a non Rack application, but I want to use Capybara and Rspec. I have configured Capybara to work with Selenium or Webkit. This is blog post
Announcing Intercity Opensource
An easy way to manage your rails servers!
Scaling Applications with Multiple Database Connection
Applications depending on databases can be scaled by separating the database layer and scaling it independently. The OPS team does take care of such infrastructure changes based on the application deployment architecture. Read the full article at RailsCarma Blog
Routing and Multi-View Apps in Volt (Screencast)
Check out Episode 13 where I give a quick overview of how Volt handles URL routing.
qk/quik - ruby quick starter template script wizard .:. the missing code generator
Hello, I’ve put together the quik gem that includes a new ruby quick starter template script wizard. Let’s say you want to start a new gem. Try: $ quik new gem or $ qk n gem This will download the gem.rb wizard script from the Rubyref Scripts repo and run through all steps to get you started with ready to use code (from a git repo hosted template). Note, qk/quik is “generic”, that is, it works for sinatra templates, gli templates and anything. For static site (e.g. jekyll) starter scripts, for example, see Mr Hyde’s Scripts (built with mrh/mrhyde and the qk/quik machinery). Cheers.
Associative arrays in Ruby…what?
Have you ever had a bunch of data in an array, but needed to do a key/value lookup like you would with a hash? Fortunately, Ruby provides a mechanism for treating arrays as key-value structures. Let’s check it out! http://blog.honeybadger.io/associative-arrays-in-ruby-what/
Introduction to Roda
I wrote an introduction to the Roda web framework.
Composing custom RSpec matchers in Cucumber
An example of using custom matchers in Cucumber, composing several matchers to test related things at once, and generating useful failure messages.
Infoboxer: use Wikipedia as datasource
An infoboxer gem is a huge effort to allow automated information extraction from Wikipedia and other MediaWiki sources. Here is a blog-post, explaining how and why.
HasDefaultAssociation
Setting default values in ActiveRecord is a bit tricky, default associated records, trickier still. See how HasDefaultAssociation manipulates ActiveRecord associations to provide easy defaults. You’ll learn about Rails and touch of metaprogramming as well.
Safer SQL: Using ActiveRecord Transactions
As your application grows, how do you make your application defensive and write safe code? ActiveRecord transactions are one way to write safer SQL statements. This blog post examines the transaction method under the hood, and highlights the golden rules of transacting.
Curated list of Ruby libs for web-scraping and data-processing
I build a list of web scraping and data processing libs for a number of languages. At the moment I have lists for ruby, python and PHP. The list for ruby:
Tips for participating in the rails rumble
The Rails Rumble is the biggest international Rails hackathon and it’s organized once a year - over 100 teams distributed across the globe, each with 4 members fabricating an awesome Rails app in 48 hours. The next one is on the 7th and 8th of November and here’s some tips on how to prepare your team!
Magic Numbers in Ruby & How You Make Them Disappear
Magic numbers sound exciting. Maintaining code that uses them is not. Learn from real world Rails projects to see how experienced developers use clarifying constants to avoid magic numbers in their work:
How To Set Up A Rails Application On Main Domain With Passenger?
Here are the steps to set up a Rails Application on Main Domain with Passenger : 1. Upload your application to the server using either ftp/sftp or SSH or if you have your application under version control, checkout or clone your application to a folder in your home directory. To read full article, visit RailsCarma Blog .
Gems != Magic
Ruby gems can seem magical. Usually, one (or more accurately: thirty) solution to a problem exists in the form of a gem. Using gems is easy and intuitive. Simply add a line in the project root’s Gemfile and run bundle install. Then, either require the name of the gem or, if using Ruby on Rails, start using the gem’s code immediately anywhere in the project. It is important to understand that gems are tools, not magic.
Gr8 - a great CUI command for Rubyist
Gr8 brings Ruby power (such as map, select, inject, grep, sort, max, …) into command-line. See for details and examples.
Reconstructing Payloads With Lua
Further exploration on maximizing cache performance for Ruby apps. See how Lua can dramatically speed up API response construction:
Automating the commandline using ruby
Learn about how you can automate the commandline using Greenletters in this post
Three most telling files in legacy Rails apps
In this blog post, I want to show you three simple techniques we use to get ourselves a solid starting point for working with legacy Rails apps. You will be able to apply it to projects you’re working on and improve your planning and refactoring thanks to it.
Eliminating Roundtrips with Preconnect
The preconnect HTML hint allows the application to tell the browser which sockets it will need ahead of initiating the actual requests; preconnect eliminates DNS, TCP, and TLS roundtrips from the request’s critical path.
Null Object pattern in practice
I wrote about eliminating if-statements by making a special case object with the same interface as the normal situation. You can read about in Null Object pattern in practice