Topic: template_exists? deprecated in edge rails?
in rails 2.3 template_exists? seems to be deprecated.
Anybody knows how to build a proper subsitute for this or have a better solution for dealing with a static_controller?
You are not logged in. Please login or register.
Rails Forum - Ruby on Rails Help and Discussion Forum » Other Rails Programming » template_exists? deprecated in edge rails?
in rails 2.3 template_exists? seems to be deprecated.
Anybody knows how to build a proper subsitute for this or have a better solution for dealing with a static_controller?
I've already solved the problem by myself.
In add the following in my static_controller.rb
private
# Define template_exists? for Rails 2.3 (cause it's deprecated)
unless ActionController::Base.private_instance_methods.include? 'template_exists?'
def template_exists?(path)
self.view_paths.find_template(path, response.template.template_format)
rescue ActionView::MissingTemplate
false
end
end
Regards