Flex on Rails book source code updated for Rails 2.3.2

Sunday, May 3, 2009

Rails 2.3.2 introduces some changes that required that we adapted the code from our book. I just reviewed and update the code for chapter 2,3,4,7,18,20 and 22 to run with Rails 2.3.2 and Flex SDK 3.3. Tony will do some more work on checking RubyAMF and the chapters he wrote code for. So here is quick look at the changes:

- In Rails 2.3.2 the file containing the application controller class must be renamed from application.rb to application_controller.rb.

- Another change introduce since the new rack middleware stack is that adding _method=put to the url isn't recognized by rails in the case of a post. However it's still recognized for the delete, so I am not sure what's going on and if the Rails guys will reinstate the _method= in the near future. Fortunately Rails recognizes the X_HTTP_METHOD_OVERRIDE request header. So for updates we set this header in Flex. Now Flex doesn't set the headers if the body of the message is empty like for delete, so we still use the _method=delete for deletes. It would be nice to be able to set this in a consistent manner for both deletes and updates.

- On chapter 04 on testing with Fluint we moved to using fluint 1.1.1, and no changes was require for this.

- On chapter 20 Server Push with Juggernaut I updated using the latest plugin downloaded from github and no more the code from rubyforge and updated gem version for eventmachine to 0.12.6 and the json gem to 1.1.4. So installing the plugin is now done with the following command:


./script/plugin install git://github.com/maccman/juggernaut_plugin.git


If you find any other issues with Rails 2.3.2. send me an email or leave a comment on this blog post. Thanks to all the readers that submitted comments so far.

Enjoy!
Daniel

Labels: ,

Upside down chapters?

Thursday, January 29, 2009

The other day while giving away seven books at the Derailed (Denver Ruby on Rails User Group) one attendee noticed that one the books had some chapters that where upside down (around page 166). I didn't think much of it, but today a coworker from Tony who bought the book noticed the same thing. All the pages are there but for some of the chapters you will need to turn the book upside down. Please drop us a line (d[at]n-so.com) if you experience the same. I am not sure how broad the issue is and in fact it's out of my hands, but we would like to keep the publisher informed of this. I am not sure how they deal with a situation like that, but let's find out.


Labels:

© 2008 Flex On Rails. All Rights Reserved