When you need to use diff in either some Ruby code or your Rails app, use the differ gem.
Code example for implementing Cross-Origin Resource Sharing (CORS) in Rails.
To offer files for download, use send_file. def download(file) send_file file.path, :disposition => 'attachment' end
Passenger gives you the possibility to define in which environment your app should be started. This has to be added...
The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str...
Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb:
Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...
This note describes how to kick a user out of a Rails application after she hasn't requested an action...
When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').
Free Hoptoad/Airbrake alternative which can capture exceptions from any platform. It comes with a Rails notifier and a RESTful API...
This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...
Note that this card is very old. You might want to use ActiveType for your auto-coerced virtual attributes instead...
Leads to awesomeness and unicorns when used in production.
We are changing our name from Hoptoad to Airbrake. You see, some folks much larger than us reached out and...
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
Install Ruby from the Ubuntu repository: sudo apt-get install ruby ruby-dev \ ruby is the meta package. If you...
Here are some popular mistakes when using nested forms: You are using fields_for instead of form.fields_for.
We're adding a script console-for to open a remote Rails console with one command. Also have a look...
You probably need to activate X-Sendfile.
Ever wondered if there is a reverse for Rails' .each(&:to_s) idiom? Turns out there is... You probably already...
To obtain a list of Passenger processes with their application directories and memory usages, you can say sudo passenger-memory...
When you encouter an unsafe string that you actually made html_safe before, perhaps you called one of the following...
When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding...