I have held off using Rails 2 on our existing apps for a while now and I decided it was time to give it a try. We have a number of apps running on various releases of rails 1.2 but I always figured it would be too much work to upgrade them. However its turns out to be pretty easy.
First off I ran:
rake rails:freeze:edge TAG=rel_2-0-2
The funny thing is that you have to run this twice. The reasoning is that the first time you run it you are running your rake command from rails 1.2, which isn't aware of several new pieces of rails 2, in my case Active Resource.
So if you get this error:
..vendor/rails/railties/lib/initializer.rb:159:in
`require_frameworks': no such file to load—active_resource
All you need to do is run the rake command the second time.
The advantage of freezing is that you can easily unfreeze later if you run in to problems.
The next item that came up is that a session key needs to be set in the environment.rb file. This takes the form of:
config.action_controller.session = { :session_key => '_project_session', :secret => 'blahblahblahblahblahblahblahblah' }
where the blah blah bit is a genuine key.
Without this the rails 2 app doesn't want to start.
Once those two were resolved our apps started up fine. They still nag about a few things, mostly deprecated items in our code. The only other config item that we had change was that
in config/environment/development.rb the line
config.breakpoint_server = true
has no effect anymore and I just commented it out.
So all in all its pretty easy to upgrade, and although your milage may vary, I'd recommend giving it a shot.
For those of you interested in Rails Development, we recently purchased a copy of The Rails Way by Obie Fernandez. It is the best rails book I have read bar none.
Don't get me wrong, the Pragmatic books are excellent too but The Rails Way takes it to a whole new level, going in to the detail you will need as you try to progress beyond the basics of rails.
I've been doing rails sites for one and a half years now and I am still learning stuff thanks to this book. It even has a forward by DHH (He hates that apparently, but it sounds too familiar to call him David as he prefers.)
I noticed the O'Reilly Rails Conf Europe for 2008 site is up. Its on the 2nd to the 4th of September in Berlin.
I'd be very interested in having Marino Software there in force but I am wondering is it worthwhile. Did anyone go to the 2007 version? Did you pick up anything worthwhile?
I've wanted to experiment with some of the outsourcing sites like ODesk for a while now. It always sounds like a good idea but when I head stories about outsourcing it often falls flat.
I've just posted a test job though. You can see it here: Rails Manager
The idea is I'll get someone to build a simple rails manager for Leopard and see what happens. If its good I'll put it up for download. Its a small enough app that its not a big risk and its no risk to our core business.
I'll continue to post updates on how we get on, but I'm getting worried now. The job is posted an hour and we have no bids :(
The guys over at Rails Envy have done a fantastic presentation on Rspec testing of rails applications.
To be honest its been on my list for a while to look at RSpec and this is just the kick I need to do it. How I leaned to love testing
Rails Envy is definitely one for the feed reader.
Dan Cederholm (Designer) and Dan Benjamin (Developer) have sold their excellent web collaboration project Cork'd, which was made out of a passion and interest in wine. Cork’d is a free service for reviewing, sharing and discovering wine. It was made using Ruby on Rails and Dan Cederholm has pointed out a few times his positive experience using Rails as a web designer, comparing it to sculpting, which has been also my own experience working Ruby on Rails here.
Cork'd was made in the spare time of the designer and developer and has a community of over 20,000 users today. I don't have any idea how it scores on revenue but it is impressive all the same. Shows what can be done when a project is your own, has a very clearly defined audience, you have the tools and ability to make it, and you are passionate about it.
Dan Cederholms post on the sale...
Dan Benjamins post on the sale...
In the last few days I wanted to create part of our address entry partial using text_field_with_auto_complete. I did some googling but in the end it required some brain power to figure out myself.
Adding them is easy. I have a Country, County and Location entry field so I added three text_field_with_auto_complete boxes, one for each like so:
<div class="formElement"><label>Country: </label>
<%= text_field_with_auto_complete
:country, :name,{}, :indicator => "country_activity" %>
<span id="country_activity" style="display:none;" ><%= image_tag 'spinner.gif'%>
</span></div>
and so on. The indicator attribute allows you to specify an element in the document which becomes visible while the text_field_withautocomplete is carrying out a query.