Change / Update SSL certificate for Amazon Elastic Load Balancer

Posted Over 12 years ago by Kim Klotz.
awsdocs.s3.amazonaws.com

There is a new card about how to do this with the new AWS Command Line Interface

Disable output when using cURL

Posted Over 12 years ago by Arne Hartherz.

cURL makes a web request and shows you the response body. You can redirect the response body to /dev/null just...

Make an HTTP request to a machine but fake the hostname

Posted Over 12 years ago by Arne Hartherz.

Consider you have a website vhost listening to www.example.com, redirecting all incoming requests that do not talk about the configured...

Fixing "Lock obtain timed out: SimpleFSLock" for Solr

Posted Over 12 years ago by Arne Hartherz.

If your application raises an error like … Couldn't connect to the Solr server at http://127.0.0.1:8983/solr. 500 "Lock...

Dragging a file into your terminal pastes the file path

Posted Over 12 years ago by Henning Koch.

When you drag a file from a Nautilus window into a terminal window, the file's path will be pasted...

How to install a frozen version of Firefox for your Selenium tests

Posted Over 12 years ago by Henning Koch.

Whenever Firefox updates, all your Cucumber features that use Selenium break. This is annoying. In order to remedy this, version...

Turn off SSL for scenarios with Selenium

Posted Over 12 years ago by Dominik Schöler.

Selenium does not speak SSL because it uses WEBrick that doesn't. When you use Selenium for Cucumber scenarios that...

Let a Rails 3 application make a request to itself

Posted Over 12 years ago by Henning Koch.

Ever wondered how Rails talks to itself in a Cucumber feature? In Rails 3 you can do it like this...

How to use Rails URL helpers in any Ruby class

Posted Over 12 years ago by Henning Koch.

If you have any class which requires access to some path methods generated by your routes. Even though you could...

Let Webrat make a POST request

Posted Over 12 years ago by Dominik Schöler.

Just add the parameter :post to the visit method: visit publish_entry_path, :post

Webrat doesn't follow redirect because it considers the url external

Posted Over 12 years ago by Dominik Schöler.

Rails doesn't know which host it is running on. For generating links, it strips the hostname off the request...

Ruby GetText will eval scripts containing ActiveRecord classes

Posted Over 12 years ago by Arne Hartherz.

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

Capybara - The missing API

Posted Almost 13 years ago by Henning Koch.

The Capybara API is somewhat hard for parse for a list of methods you can call on a Capybara node...

Always store your Paperclip attachments in a separate folder per environment

Posted Almost 13 years ago by Henning Koch.

tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...

Nginx Error "413 Request Entity Too Large"

Posted Almost 13 years ago by Kim Klotz.
wiki.nginx.org

If you get the error "413 Request Entity Too Large" from Nginx client_max_body_size is too low (default...

Check whether a Paperclip attachment exists

Posted Almost 13 years ago by Henning Koch.

Don't simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and...

Cross-Origin Resource Sharing - Wikipedia

Posted Almost 13 years ago by Lexy.
en.wikipedia.org

Cross-Origin Resource Sharing (CORS) is a browser technology specification, which defines ways for a web service to provide interfaces...

Responding to the OPTIONS HTTP method request in Rails: Getting around the Same Origin Policy

Posted Almost 13 years ago by Lexy.
codeodor.com

Code example for implementing Cross-Origin Resource Sharing (CORS) in Rails.

Zip files with Ruby

Posted Almost 13 years ago by Dominik Schöler.
bitbucket.org

When you need to zip up files in Ruby, use zipruby. sudo gem install zipruby You can add existing files...

Downloading files from Ruby on Rails

Posted Almost 13 years ago by Dominik Schöler.

To offer files for download, use send_file. def download(file) send_file file.path, :disposition => 'attachment' end

Resque: Clearance authentication for dashboard

Posted Almost 13 years ago by Tobias Kraze.

Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb:

Delete a Clearance session after some time of inactivity

Posted Almost 13 years ago by Henning Koch.

This note describes how to kick a user out of a Rails application after she hasn't requested an action...

Rails 3: Sending tempfiles for download

Posted Almost 13 years ago by Henning Koch.

When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...

url_for with added params

Posted Almost 13 years ago by Henning Koch.

You cannot say this because url_for only takes one parameter: url_for(@deal, :tab => 'general') # won't work