Tag: Rails

Howto Display a GitHub Changelog in your application

June 27th, 2009, 2 Comments

In this post I will show you a simple way to display a list of your GitHub changes inside your application.

This can be useful for so many reasons, not least helping to create a better relationship between your users and your developers. This obviously would not be applicable in all circumstances, but in many cases, [...]

Set your Rails Environment Globally

June 20th, 2009, Comments Off

In much of the rails documentation it is suggested that when you want to run a task in a specific environment, you should set the RAILS_ENV environment variable on the command line where you are running the task.
For example, assume you want to run rake db:migrate on the production system (should be done automatically [...]

Setting User’s Locale Based on Domain Name In Rails

June 18th, 2009, 2 Comments

In this tutorial I will show how you can quickly set the user’s locale based on the domain name they use to access your website. Let us assume you have your app, and you also own your own domain in several different country TLD’s, let’s say, you have example.com (main site), example.co.uk, example.fr, example.it example.es, [...]

Mass Find/replace for Rails Tests

May 26th, 2009, Comments Off

After upgrading an old project to Rails 2.3.2,my tests were failing to run, bombing out with an error like:
./test/unit/my_model.rb:4: undefined method `fixtures’ for MyModelTest:Class (NoMethodError)
This was because in Rails 2.3.2, tests have to derive from ActiveSupport::TestCase, and not the old Test::Unit::TestCase.
A quick find and replace soon has us up and running again:
perl -pi -w -e [...]

FIX: TypeError: wrong argument type nil (expected Module)

April 29th, 2009, Comments Off

If you were using an old ARMailer gem, then removed it and installed another, more frequently updated version, (eg, “adzap-ar_mailer” from Github), you might receive the following error when attempting to send mail:
TypeError: wrong argument type nil (expected Module)
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:109:in `extend’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:109:in `initialize_template_class’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/object/misc.rb:39:in `returning’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:108:in `initialize_template_class’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:564:in `render’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:552:in `render_message’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:493:in `create!’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:452:in `initialize’
from [...]

Feed

http://www.mendable.com / Rails