Skip to content
Browse files

Hack which uses layout theme but crashes if it doesn't exist, now it …

…loads the default layout
  • Loading branch information...
1 parent 59d3645 commit e6a4c5ecf26318dbdd6922c2234479f1e930720f riven committed Sep 9, 2010
Showing with 18 additions and 16 deletions.
  1. +18 −16 lib/theme_support/patches/abstractcontroller_ex.rb
View
34 lib/theme_support/patches/abstractcontroller_ex.rb
@@ -32,19 +32,21 @@ def current_theme(passed_theme=nil)
end
end
-AbstractController::Layouts.module_eval do
- def _normalize_options(options)
- super
-
- if _include_layout?(options)
- layout = options.key?(:layout) ? options.delete(:layout) : :default
- value = _layout_for_option(layout)
- options[:layout] = (value =~ /\blayouts/ ? value : "layouts/#{value}") if value
- end
-
- if current_theme
- theme_path = File.join(Rails.root, "themes", current_theme, "views")
- options[:layout] = File.join(theme_path, options[:layout])
- end
- end
-end
+# Hack which uses layout theme but crashes if it doesn't exist !
+# Now it loads the default layout
+#AbstractController::Layouts.module_eval do
+# def _normalize_options(options)
+# super
+#
+# if _include_layout?(options)
+# layout = options.key?(:layout) ? options.delete(:layout) : :default
+# value = _layout_for_option(layout)
+# options[:layout] = (value =~ /\blayouts/ ? value : "layouts/#{value}") if value
+# end
+#
+# if current_theme
+# theme_path = File.join(Rails.root, "themes", current_theme, "views")
+# options[:layout] = File.join(theme_path, options[:layout])
+# end
+# end
+#end

0 comments on commit e6a4c5e

Please sign in to comment.
Something went wrong with that request. Please try again.