Month: July 2013

Rails select method with default value

When using the select form builder method in rails, for instance: f.select In conjunction with the options_from_collection_for_select method, like f.select :field, options_from_collection_for_select(@fields, ‘id’, ‘name’) Remember, there is a fourth argument in the above method, which defines the selected value, like so f.select :field, options_from_collection_for_select(@fields, ‘id’, ‘name’, @object.field)

Keep heroku from falling asleep / idling (even with PHP)

Ruby on Rails Scenario The easiest way to keep a Rails App from idling is to use New Relic Standard (free), in conjunction with their availability monitoring. You can do this in a couple of ways: Issue the following command with the Heroku Toolkit heroku addons:add newrelic:stark Or, login to your heroku account and provision […]

Monitor production resque with local resque-web

This post assumes you are processing background jobs on a development/production environment utilizing Redis and Resque. If you’re monitoring your local resque instance with resque-web, just run the following commands to change the resque-web’s redis reference to your production redis instance resque-web -K resque-web -r [your redis location] If you’re using RedisToGo, for instance, you […]