Friday, October 15, 2010

[Rails] include ActionView::Helpers in Rails 3?

How do you do the equivalent of:

module MyLibrary
include ActionView::Helpers::AssetTagHelper
end

...in Rails 3?

I'm trying to upgrade my app from 2.3.9 to 3.0.1 and I have some stuff
in /lib that needs to include these helpers from ActionView. It works
fine in 2.3.x, but in 3.x it's giving me the error:

undefined local variable or method `config'

One of the methods in AssetTagHelper now tries to access
controller.config.perform_caching, but since no controller exists in
my library, it flips out. Any way around this?

Thanks!
Marc

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate