web.archive.org

There is a common view that extracting text from a PDF document should not be too difficult. After all, the...

Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...

makandra dev
api.rubyonrails.org

Rails includes a way to see what an e-mail will look like. Integration to RSpec All you need to...

When giving a presentation where you do some coding, the font size you usually use is probably a bit too...

When using tmux, selecting and copying multiple lines of text can be a hassle, especially when using splits (highlighting lines...

jsbin.com

If you try to listen to events on elements that are nested inside a , Firefox will stop event propagation once...

github.com

When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name' with t('.name_prompt'). You...

makandra dev
impactahead.com

Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...

postgresql.org

PostgreSQL offers a really handy field type: json. You can store any JSON there, in any structure. While its flexibility...

...the file system. Since load order can be important, this may lead to different behavior on different machines which are hard to debug. Simply add a .sort: Dir.glob(Rails.root.join('lib/ext...

before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...

In the discussion of the difference between include and extend in Ruby, there is a misconception that extend would add...

bibwild.wordpress.com

While debugging an intricate issue with failed HTTP requests I have come to appreciate the more advanced features of the...

In general, you should not put a block element inside an inline element. So don't do this: text

...often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs desktop navigation menus). Since you want your integration tests to behave...

...metrics". This allows you to configure dimensions larger than your display and enable/disable touch behavior. Simply use register_driver to set up a driver that you then connect to Capybara...

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

It's possible to implement simple custom RuboCop cops with very little code. They work exactly the same like existing...

When using Rails credentials, you will edit the encrypted credentials for staging or production environments from time to time. To...

This Capistrano task runs a command on all servers. bundle exec cap production app:run cmd='zgrep -P "..." RAILS_ROOT/log/production.log...

This card describes different flavors for concatting HTML safe strings in a helper method in Rails. You might want to...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

...be slightly off their original value. Consider using DECIMAL instead. Decimals have well-defined behavior for rounding and range overflows...

If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...

developer.mozilla.org

Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to...