Created
August 26, 2010 10:37
-
-
Save glaville/551205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/scaffolding_extensions/controller/ramaze.rb 2010-08-26 06:18:19.000000000 +0200 | |
+++ b/lib/scaffolding_extensions/controller/ramaze.rb 2010-08-26 12:31:23.438577289 +0200 | |
@@ -96,10 +96,18 @@ | |
layout(:layout){|name, wish| !request.xhr? } | |
o = app.options | |
- o.roots = [scaffold_template_dir] | |
- o.views = ['/'] | |
- o.layouts = ['/'] | |
- | |
+ o.roots ||= [] | |
+ o.views ||= [] | |
+ o.layouts ||= [] | |
+ | |
+ # Adds scaffolds directory to the controller's App roots | |
+ unless o.roots.include?(scaffold_template_dir) | |
+ o.roots = [*o.roots, scaffold_template_dir] | |
+ end | |
+ | |
+ o.views << '/' unless o.views.include? '/' | |
+ o.layouts << '/' unless o.layouts.include? '/' | |
+ | |
include ScaffoldingExtensions::Controller | |
include ScaffoldingExtensions::RamazeController | |
include ScaffoldingExtensions::Helper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment