Category Archives: Ruby / Rails

Generate I18n locale files from Rails views and models

I made a little rake task to allow you to scrape your views for translation calls, and also run through models and generate locale files. The model scraping allows the resulting file to be used with formtastic. There are plenty … Continue reading

Posted in Development, Ruby / Rails | 2 Comments

Email to Ruby script to google calendar

We receive notifications at the office from the iDEAL payment system in the Netherlands when there is planned maintenance or disturbances. It’s pretty difficult to visualise the downtime in the text form we get it in, so I thought it … Continue reading

Posted in Development, Ruby / Rails | Leave a comment

Google4R Checkout and Rounding Policy

I’ve been using google4r-checkout for an integration of google checkout with one of my clients site. On the site I’m calculating VAT per line and by default I think google checkout does it per item. 90% of the time this … Continue reading

Posted in Development, Ruby / Rails | Tagged , , , , | Leave a comment

Rails javascript specific layout

Recently I’ve started to favour using small snippets of js.erb for each controller action over using one monolithic javascript controller designed to run the whole application. It means you have small manageable pieces of code which are only loaded when … Continue reading

Posted in Development, Ruby / Rails | Tagged , , , | 1 Comment

Acts As State Machine error handling

What is it? Acts as state machine (AASM) is a rubygem for adding finite state machines to Ruby classes. http://github.com/rubyist/aasm. This is a widely used gem/plugin and is the de-facto standard for state management in Ruby on Rails. Whilst working … Continue reading

Posted in Development, Ruby / Rails | Tagged , , , , | Leave a comment

SRC10 – De-normalising rails applications

Presented by: Daniel Lucraft & Matt Wynne De-normalisation is just one of many strategies to cope with the scaling requirements of an application. It is the process of devising a method to group relevant data together in an optimal way … Continue reading

Posted in Conferences, Development, Ruby / Rails, SRC10 | Leave a comment

Rails3 beta3 Authlogic metaclass error

I noticed this problem when I tried to use authlogic today: undefined method `metaclass’ for Authlogic::Session::Base:Class (NoMethodError) Turns out the fix is pretty simple bpauly posted a comment on http://railsplugins.org with the following: metaclass has been deprecated in favor of … Continue reading

Posted in Development, Patches, Ruby / Rails | Tagged , , | 5 Comments

Automatically generating a sitemap in rails

I recently had the need to generate a sitemap using a cron job on a regular basis (nightly) for my ruby on rails app. I found the excellent plugin from Chrisian Hellsten at http://github.com/christianhellsten/sitemap-generator. Which did the trick very nicley. … Continue reading

Posted in Development, Ruby / Rails | Leave a comment