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)
Month: July 2013
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 […]
WordPress on Heroku
I wanted a simple way to push WordPress to Heroku. It doesn’t get much simpler than this https://github.com/mhoofman/wordpress-heroku In regards to using your own custom domain name, the tutorial recommends using A records with a set of defined IP addresses. Instead, I think the better approach is to use a CNAME record pointing to your […]