The translation method translate and its alias t have bang brothers: translate! and t!. They will raise I18n::MissingTranslationData on...

Consul 0.10.0 now allows multiple power mappings for nested resources. When using nested resources you probably want two power

apidock.com

When you're writing migrations that do more than changing tables (like, modify many records) you may want some output...

In Rails 5 you can say: ApplicationController.render( :template => 'users/index', :layout => 'my_layout', :assigns => { users: @users } ) If a Request Environment is...

Simply give the select helper an option :disabled, passing either a single value or an array. You need to specify...

For Capybara, use this step: Then /^"([^"]*)" should be a disabled option for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector| with_scope(selector...

Exception notifications contain a lot of information: Backtraces, HTTP headers, etc. exception_notification tries its best to format this wall...

We tend to use database transactions as a magic bullet to get rid of all our concurrency problems. When things...

Did you know you can do in-place batch processing with plain ruby? The following script will in-place replace...

You can use xmllint to pretty-print ugly XML files on your terminal. Just say: xmllint --format file.xml

linuxsa.org.au

Here is a good explanation for zombie processes. Quote: If you have zombie processes it means those zombies have not...

makandra dev
rakeroutes.com

Put the attached files into your home directory and enjoy. .irbrc defines interesting_methods, which is essentially all methods without...

If you want a widget for awesome that runs a command regularly (every X seconds) and puts the output into...

This trick might be useful to implement more complicated directives in AngularJS. I needed it to do drag'n'drop...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...

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

view_context.helper_method('args') Rails 2 ApplicationController.helpers.helper_method('args') Also see How to use helper methods inside a model...

Spreewald's patiently repeats the given block again and again until it either passes or times out.

makandra dev

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

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

coding.smashingmagazine.com

Smashing Magazine lists some handy tricks for print style sheets, all with CSS: Expand External Links For Print

cssmatic.com

CSSmatic lets you play around with four rather complex CSS stylings and gives you CSS or SASS code to use...