When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...
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...
Exception notifications contain a lot of information: Backtraces, HTTP headers, etc. exception_notification tries its best to format this wall...
For websites that don't do JavaScript rendering on the client, it's best practice to put script tags at...
Using CSS sprites for background images is a technique for optimizing page load time by combining smaller images into a...
The ipad onscreen keyboard changes position:fixed style to position:static that misplaces those elements and you'll have problems...
Next time you have to do more than trivial CSS changes on a project, you probably want to have live...
1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...
Here is a good explanation for zombie processes. Quote: If you have zombie processes it means those zombies have not...
Our development process makes us deploy very often. As the number of releases grows, junk clogs up the hard drive...
Good article that tells you how to change behavior of certain keys via xmodmap (with the help of exv if...
New WYSIWYG editor that claims to be lighter and prettier than TinyMCE and CKEditor. Has some Rails integration, too.
As Bill Dueber has on his blog, you can call rvm in the shebang to select a Ruby version like...
If you want a widget for awesome that runs a command regularly (every X seconds) and puts the output into...
You have multiple options: Just don't have a type column. All STI magic will be disabled automatically.
When you need to find out in which kind of spec you are during run-time, it's definitely possible...
This trick might be useful to implement more complicated directives in AngularJS. I needed it to do drag'n'drop...
When HTTP clients make an request they can define which response formats they can process. They do it by adding...
We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...
Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...
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...
Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...