Posted by Andreas on Tuesday, February 12, 2008 at 08:08 (CET)
After updating to the latest edge Rails via SVN today, my local development webserver suddenly started to respond with a 500 application error for every request. The mongrel console revealed:
NoMethodError (undefined method `file_exists?’ for #<ActionView::Base:0x2aaaac3eee10>):
/usr/lib64/ruby/gems/1.8/gems/gettext-1.90.0/lib/gettext/rails.rb:280:in `render_file’
/usr/lib64/ruby/gems/1.8/gems/gettext-1.90.0/lib/gettext/rails.rb:278:in `each’
/usr/lib64/ruby/gems/1.8/gems/gettext-1.90.0/lib/gettext/rails.rb:278:in `render_file’
/vendor/rails/actionpack/lib/action_controller/base.rb:1107:in `render_for_file’
/vendor/rails/actionpack/lib/action_controller/base.rb:841:in `render_with_no_layout’
:
:
Digging deeper, I found out that the method ActionView::Base#file_exists? has been moved to a different place in Rails’ Changeset 8683. Fortunately, fixing it is easy.
Read more »
Posted by Andreas on Monday, September 17, 2007 at 06:09 (CEST)
Did you ever want to create multiple models in one action? E.g. if your user model has many email addresses, create a user record and his first email address when he signs up… Nick of Pivotal Blabs wrote a nice article about it – but it almost drove me to despair this morning when I was trying to break it down to my user and email addresses model.
Read more »
Posted by Andreas on Friday, September 21, 2007 at 09:09 (CEST)
This morning I faced a strange problem when trying to write RSpec tests for a user login action. Trying to setting the flash before doing a request, resulted in an unexpected Exception:
TypeError in ‘SessionController logging in with correct credentials should redirect to the url_after_login url if given’
can’t convert String into Integer
…/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/functional.rb:80:in `flash’
./spec/controllers/session_controller_spec.rb:52:
./script/spec:4:
Read more »
Posted by Andreas on Saturday, November 17, 2007 at 18:11 (CET)
A minor bug in TMail (which is used in Rails’ ActionMailer) got fixed finally.
About 2 years ago, I reported bug #6015 to the Ruby on Rails bug tracker. TMail’s create_forward method always returned the first body part of a newly created forwarded mail instead of the forwarded mail itself. Therefore the create_forward method was practically useless. At that time, the ActionMailer and/or TMail developers didn’t seem to be very active. Well… nobody cared about this for about two years.
After I heard that TMail got a new maintainer, I gave it another try and submitted bug #15445 to the newly created TMail bug tracker. Mikel (who is the new TMail maintainer) applied and tested a fix, so the upcoming TMail version will come without this bug. Thanks a lot, Mikel.
Let’s hope this fix will make it into Rails 2.0 so that I can dump one more workaround in my application soon.
Latest comments