Bugfixes and Rails Edge
Update to Rails 2.3.1. (Actually, not quite. Doesn't look like 2.3.1 will be released today, but I REALLY want to push these bugfixes out.) Removed bundled Rack (Rails 2.3.1 comes bundled with Rack 1.0). Add config.action_view.cache_template_loading = true to production environment. Fix FastCGI bug (http://rubyforge.org/tracker/index.php?func=detail&aid=24191&group_id=186&atid=783). Fix WikiWords bug (http://rubyforge.org/pipermail/instiki-users/2009-February/001181.html).
This commit is contained in:
parent
0ddef97328
commit
133c21b801
641 changed files with 20541 additions and 71675 deletions
22
vendor/rails/actionpack/lib/action_view/paths.rb
vendored
22
vendor/rails/actionpack/lib/action_view/paths.rb
vendored
|
@ -2,12 +2,16 @@ module ActionView #:nodoc:
|
|||
class PathSet < Array #:nodoc:
|
||||
def self.type_cast(obj)
|
||||
if obj.is_a?(String)
|
||||
Template::EagerPath.new(obj)
|
||||
if Base.cache_template_loading?
|
||||
Template::EagerPath.new(obj.to_s)
|
||||
else
|
||||
ReloadableTemplate::ReloadablePath.new(obj.to_s)
|
||||
end
|
||||
else
|
||||
obj
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def initialize(*args)
|
||||
super(*args).map! { |obj| self.class.type_cast(obj) }
|
||||
end
|
||||
|
@ -31,8 +35,12 @@ module ActionView #:nodoc:
|
|||
def unshift(*objs)
|
||||
super(*objs.map { |obj| self.class.type_cast(obj) })
|
||||
end
|
||||
|
||||
def load!
|
||||
each(&:load!)
|
||||
end
|
||||
|
||||
def find_template(original_template_path, format = nil)
|
||||
def find_template(original_template_path, format = nil, html_fallback = true)
|
||||
return original_template_path if original_template_path.respond_to?(:render)
|
||||
template_path = original_template_path.sub(/^\//, '')
|
||||
|
||||
|
@ -46,12 +54,16 @@ module ActionView #:nodoc:
|
|||
elsif template = load_path[template_path]
|
||||
return template
|
||||
# Try to find html version if the format is javascript
|
||||
elsif format == :js && template = load_path["#{template_path}.html"]
|
||||
elsif format == :js && html_fallback && template = load_path["#{template_path}.#{I18n.locale}.html"]
|
||||
return template
|
||||
elsif format == :js && html_fallback && template = load_path["#{template_path}.html"]
|
||||
return template
|
||||
end
|
||||
end
|
||||
|
||||
Template.new(original_template_path, self)
|
||||
return Template.new(original_template_path, original_template_path =~ /\A\// ? "" : ".") if File.file?(original_template_path)
|
||||
|
||||
raise MissingTemplate.new(self, original_template_path, format)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue