You can detect city and country from an IP address by using the GeoLite database. This is a flat file...

You probably haven't configured version control for your project. Go to Project Settings / Version Control and set the director...

When you download or upgrade RVM it has a hardcoded notion which patch level it considers to be "1.9.3".

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...

github.com

When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

In specs, the session never persists but is always a new object for each request. Data put into the session...

aaronlasseigne.com

All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...

apidock.com

All columns of a model's database table are automagically available through accessors on the Active Record object.

thejh.net

What you copy may not be what you see in the browser. Here is an online tool to determine the...

Say you want to allow users to emphasize some string, but the whole markdown thing would be far too much...

nt.ntnu.no

yaml4r is a juxtaposition of yaml documents and their Ruby couterpart. Thus, it does a great job as YAML-doc...

Sometimes you might want to limit the number of associated records in a has_many association, but cannot add a...

makandra dev

Ever wondered about the difference between def and define_method? Turns out there are three implicit contexts in Ruby. def...

The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the...

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...

To set a cookie in your test browser for cucumber tests, you need to know which driver you are using...

tenderlovemaking.com

In Ruby, the meaning of protected and private is different from other languages like Java. (They don't hide methods...

stackoverflow.com

Access the Method object Dead simple: Get the method object and ask for its owner: "foo".method(:upcase) # => #

Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.

For example if you use rvm and get this message: ERROR: Loading command: install (LoadError) no such file to load...

Consider this class: class Foo private def test puts "Hello" end end While you can say create a block to...