Phil McClure

Showing all posts tagged rails:

I finally got round to making the relevant changes to allow the green_light gem to work with Rails 4. This has been long overdue since there are quite a lot of legacy apps making use of it. There is one main difference to take note of in this re...
Just upgraded one of my apps from Rails 3.0.0rc4 to Rails 3.0.0. One issue - all the forms disappeared! After doing some hunting, I found that the issue was being caused by the HAML gem. To fix this, upgrade to the 3.0.18 release of the HAML ge...
Sometimes it's useful to interact with your controllers via the console. This, as you may know, can be achieved with the app object. You can perform GET, POST, PUT and DELETE requests by doing the following. If you need to login to your Rails a...
While upgrading one of my Rails 2.3 apps to Rail 3, I came across a few issues when using subdomains with a localhost domain. I have a route like so:- root :to => 'controller#page', :constraints => {:subdomain => "subdomain1&am...
I was getting a ActionController::InvalidAuthenticityToken destroy error when using the Destroy method in my Rails 3 app. Turns out, when I was migrating to Rails 3, I forgot to include this in the html header:- I couldn't find a solution anywhe...
This one confused the hell out of me. Suddenly, my css styling of the fieldWithErrors div stopped working. Turns out this has been changed to field_with_errors. Check it out here. The change seems to have taken place between beta 3 and beta 4.
Worth noting that error_messages_for is not included, by default, in Rails 3. If you check your console server log you'll see this warning:- DEPRECATION WARNING: error_messages_for was removed from Rails and is now available as a plugin. Please i...
I've been looking for some information on the unobtrusive javascript features in Rails 3, and it turns out that there's not much out there! Either that, or I'm looking in the wrong places. So here is my attempt to explain some of the features. I...
I was just looking into including some Rack middleware in my Rails 3 app. One thing confused me slightly. There seems to be two ways that you can include middleware in you app:- 1. config.ru http://gist.github.com/306481.js?file=config.ru"&...
Came up against this recently when trying to upgrade a Rails app which was using MongoDB. Obviously I didn't want to use ActiveRecord, so I set about removing it. The old way of removing ActiveRecord was to place this line in the environment.rb f...