Let’s say you’re on the Github page for rails/rails . Copying the URL from the top of the page, pasting it into the terminal takes too dang long! Instead, put this in your ~/.gitconfig : # ~/.gitconfig [url "git://github.com/"] # Read-only insteadOf = gh: In the terminal: $ git clone ...
#16 Virtual Attributes (revised) Jul 20, 2012 | 11 minutes | Active Record , Forms Virtual attributes are a clean way to add form fields that do not map directly to the database. Here I show how to handle validations, associations, and more. Subscribe to Watch Episode Tweet Show Notes...
StarTrader added about 2 hours later: I like the implementation as a concept, but I am concerned about what the results would be for client code. This would seem to encourage the creation of an arbitrarily large number of Error classes. To my mind the goal of raising an error is to ha...
Pry is an alternative to IRB and sports many great features. Here I show how to integrate it into a Rails app, and how it can aid in debugging.
Posted March 17, 2008 at 9:48 AM | Permalink You probably should make a clearer distinction between Ferret and acts_as_ferret. Ferret is the underlying Ruby implemention of Lucene. It provides generic full-text searching. Acts_as_ferret is a nice Rails plugin that integrates Ferret wi...
For Rails 3.1, we wanted a mostly-compatible solution with the same programmer benefits as the existing model, but with all the benefits of automatic flushing. After a number of very long discussions on the topic, José Valim came up with the idea of using Ruby 1.9 fibers to jump back ...
Controllers are tricky to test, and there's no perfect way to do it. In this episode you will see how I test controllers, and my reasoning behind it.
RSpec ベストプラクティス RSpec は、振舞駆動の設計プロセス (behaviour driven design process) において、人間にとって読みやすい仕様を書くための優れたツールです。RSpec で書かれた仕様が、アプリケーション開発における方向と検証を行います。本記事では私たちが気づいた、エレガントで保守しやすい仕様を書くためのプラクティスを紹介します。 まず、何をしてるのかを #describe で説明しましょう 定義するつもりのメソッドごとに、#describe を使うことから始めましょう。このとき引数にはメソッド名を指定します。クラス...
Говорят, что расширение классов ядра (monkey-patching) — это зло. Тут еще некоторые ведут споры касательно того, что считать monkey-patching’ом — добавление новых методов или переопределение старых, но мы обойдем этот спор стороной и сконцентрируемся на том, как это делать безболезнен...
Rails Ticket 4339 suggests that there is a denial-of-service vulnerability because of the way the Rails request handler instantiates a symbol for every incoming request method. This is technically true, but turns out not to matter, as seen below. help i’m allocated and i can’t get rel...
Almost all email clients leave quoting of original email text when you reply. If Redmine users do not manually remove these overquotings when replying to Redmine issue emails, this commonly useless text will be posted in the end of comment. It would be nice if Redmine was able to trim...
, I gave you some introductory information on Cucumber, a great framework for writing and executing high level descriptions of your software’s functionality. In this post, I’ll take a deeper dive and talk about a few more advanced Cucumber topics: project structures, multiple language...
This episode will show you how to debug a rails app using ruby-debug: set a breakpoint, inspect variables, change the code and more.
Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other la...
Overview Download Documentation Support IronRuby IronRuby Tutorial
Ruva is a simple utility to write conditions in a human readable manner.
ROT13 is a simple letter substitution cipher; see http://en.wikipedia.org/wiki/ROT13