Posted by Mike
Sun, 12 Nov 2006 21:59:00 GMT
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.
Read more...
Posted in Nuby Rails, Rails, Ruby | Tags nuby, rails, ruby, tutorial | no comments | no trackbacks
Posted by Mike
Sun, 05 Nov 2006 20:13:00 GMT
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).
Read more...
Posted in Nuby Rails, Rails, Subversion | Tags nuby, rails, subversion | 10 comments | no trackbacks
Posted by Mike
Sun, 29 Oct 2006 00:21:00 GMT
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
Read more...
Posted in Nuby Rails, Rails, Ruby | Tags nuby, rails, ruby | 5 comments | no trackbacks
Posted by Mike
Wed, 18 Oct 2006 19:18:00 GMT
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.
Read more...
Posted in Nuby Rails, Rails | Tags nuby, rails | no comments | no trackbacks