Tech Books I Read In 2006
I read the following books in 2006. I’m writing this post to guilt myself into writing a review for each.
Posted in Books |
Cookbook3, Ruby on Rails Tutorial
The title to this blog entry is a bit misleading. This is really my notes on the implementing Curtis Hibbs’ “Rolling with Ruby on Rails” part 1 and part 2 . This is not a tutorial in and of itself but is a supplement to Curtis’s work. There must be ways to improve my code as well, so I look forward to learning from someone’s Cookbook4. My work can be found in the cookbook3.tar.bz2 file.
Posted in Nuby Rails, Rails, Ruby |
Subversion + Rails In Five Minutes
This is a quick set of subversion commands to create a repository for your Rails application. The repository is dedicated to your Rails app so the head of your source will be in the trunk, version releases will be in tags, and branches for you code base will be in branches.
Nicholas Evan’s Subversion In Fifteen Minutes is a good reference for quick subversion setup, what your getting here is the 5 minute version with Rails specifics. The HowtoUseRailsWithSubversion page at RubyOnRails goes into more detail about additional things to consider when sharing a Rails project across many developers (like how you might handle database.yml for example).
Posted in Nuby Rails, Rails, Subversion |
assert_redirected_to Expects Strings, Not Symbols and Simple Localization
I’ve been in the process of refactoring a CRUD-like webapp that I had written in PHP over to the Ruby On Rails Framework. I’m almost done with the re-factor of the object model and views and started going through A Guide to Testing the Rails to learn the Rails way of unit testing to make my code even better. I was on sub-chapter 9.4 Response-Related Assertions and came upon an error in my unit test of a controller I couldn’t quite figure out. The syntax looked right, the controller logic looked right, and the test logic looked right.
This is a recreation of the error I kept getting with the assert_redirected_to test:
$ ruby test/functional/foo_controller_test.rb
Loaded suite test/functional/foo_controller_test
Started
F
Finished in 0.029546 seconds. 1) Failure:test_invalid_language(FooControllerTest) [test/functional/foo_controller_test.rb:20]:
response is not a redirection to all of the options supplied (redirection is <{:action=>"index", :language=>"es", :controller=>"foo"}>), difference: <{:action=>:index, :controller=>"foo"}>1 tests, 4 assertions, 1 failures, 0 errors
Posted in Nuby Rails, Rails, Ruby |
WP-Notable In a Typo 4.0 Theme
Here are some quick notes on getting WP-Notable style book marking into the Scribbish Typo 4.0 Theme. This pattern would apply to other themes as well.
Typo 4.0 + Apache2 + MySQL + Gentoo
IMPORTANT!!! IMPORTANT!!! IMPORTANT!!!
This article deprecated by my Maintaining Your Own Typo 4.0.3 article.
The section in this article about the apache proxy is flawed, it doesn’t actually balance the load. There is also a better way to craft an init.d script generically for Mongrel in my new article.
I’ll leave the article in place for reference only.
IMPORTANT!!! IMPORTANT!!! IMPORTANT!!!
I’ve almost completed my Typo 4.0 + Apache2 + MySQL + Gentoo configuration. Some system administration is Gentoo flavored but I think this is a good rececipe for anyone looking to do setup of Typo 4.0 within an Apache2 instance with MySQL for the datasource.
Rails Caching Gotchas
I had been experimenting with caching with an action in one of my controllers. The action was slow doing some additional sorting of results gathered from ActiveRecord. I had made sure that I had chosen the best ActiveRecord query and that I was sorting the results in an efficient Ruby way (i.e. in place), but the action was still slow.
Posted in Nuby Rails, Rails |