Ticket #194 (closed defect: worksforme)

Opened 2 years ago

Last modified 2 years ago

Refactoring of ActionView::Base in Rails 2.1 breaks Globalize

Reported by: NickSmall Assigned to:
Priority: major Milestone:
Component: view Version:
Keywords: Cc:

Description

A previous patch was issued to Globalize that allowed it to use a number of helper methods in ActionView::Base in order to determine proper template locations and file names. However, in Rails 2.1, ActionView::Base has been completely re factored and a number of these functions have been removed or changed. I am trying to patch the issue myself, however I am fairly new at working with Rails on this low level. So for now, I am filing this as a bug report.

Change History

06/06/08 06:43:24 changed by NickSmall

  • status changed from new to closed.
  • resolution set to worksforme.

Well after a bit of tinkering, I think I got it. The two methods throwing errors were ActionView::Base.pick_template_extension and ActionView::Base.full_template_path. These methods have been moved and the latter renamed. They can now be called with @finder.pick_templte_extension and @finder.pick_template, respectively. Replacing the method calls in /globalize/lib/globalize/rails/action_view.rb with the proper names made everything work just dandy for me. Like I said, I'm pretty new at this, so I don't know how to actually submit a patch to Trac, but there you go, a solution that seems to make Globalize work just fine with Rails 2.1. Your mileage may vary. There are three method calls in that file that need to be updated. Hope that helps...

06/11/08 08:13:39 changed by fbrito

Thank you Nick Small

In short words: Go to vendor/plugins/for-1.2/lib/globalize/rails/action_view.rb In line 47 replace: "pick_template_extension" to "@finder.pick_template_extension" In line 48 replace: "full_template_path" to @finder.pick_template

Remember to restart your webserver!

Thank you again, Nick Small