Changeset 496
- Timestamp:
- 09/03/07 22:27:31 (1 year ago)
- Files:
-
- trunk/README (modified) (1 diff)
- trunk/app_generators/merb/merb_generator.rb (modified) (1 diff)
- trunk/app_generators/merb/templates/app/views/exceptions/not_found.html.erb (moved) (moved from trunk/app_generators/merb/templates/app/views/exceptions/not_found.erb) (1 diff)
- trunk/app_generators/merb/templates/app/views/layout/application.html.erb (moved) (moved from trunk/app_generators/merb/templates/app/views/layout/application.herb) (1 diff)
- trunk/app_generators/merb/templates/public/stylesheets (added)
- trunk/app_generators/merb/templates/public/stylesheets/master.css (added)
- trunk/lib/merb/exceptions.rb (modified) (1 diff)
- trunk/lib/merb/mixins/view_context.rb (modified) (3 diffs)
- trunk/specs/merb/merb_generator_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README
r456 r496 63 63 with instance vars available in the views automatically. Merb also supports 64 64 layouts. It will look for a layout named after your controller class first and 65 then fall back to application.h erb if no layout exists named after your controller.66 You can use render <tt>:layout => :none</tt>.65 then fall back to application.html.erb if no layout exists named after your 66 controller. You can use render <tt>:layout => :none</tt>. 67 67 68 68 Merb does not automatically render for you in your controller actions, you have trunk/app_generators/merb/merb_generator.rb
r464 r496 27 27 m.file_copy_each %w( global_helper.rb ), "app/helpers" 28 28 m.file_copy_each %w( application.erb ), "app/mailers/layout" 29 m.file_copy_each %w( application.h erb ), "app/views/layout"30 m.file_copy_each %w( not_found. erb ), "app/views/exceptions"29 m.file_copy_each %w( application.html.erb ), "app/views/layout" 30 m.file_copy_each %w( not_found.html.erb ), "app/views/exceptions" 31 31 m.file_copy_each %w( merb.jpg ), "public/images" 32 m.file_copy_each %w( master.css ), "public/stylesheets" 32 33 m.file_copy_each %w( database.yml merb.yml merb_init.rb router.rb upload.conf ), "config" 33 34 m.file_copy_each %w( development.rb production.rb test.rb ), "config/environments" trunk/app_generators/merb/templates/app/views/exceptions/not_found.html.erb
r466 r496 26 26 <li>config/merb.yml <strong><em>(optional)</em></strong></li> 27 27 <li>config/router.rb <strong><em>(recommended)</em></strong></li> 28 <li>app/views/exceptions/not_found. erb <strong><em>(recommended)</em></strong></li>29 <li>app/views/layout/application.h erb <strong><em>(change this layout)</em></strong></li>28 <li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li> 29 <li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li> 30 30 </ul> 31 31 </p> trunk/app_generators/merb/templates/app/views/layout/application.html.erb
r466 r496 4 4 <title>Fresh Merb App</title> 5 5 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 6 <style> 7 body { 8 font-family: Arial, Verdana, sans-serif; 9 font-size: 12px; 10 background-color: #fff; 11 } 12 * { 13 margin: 0px; 14 padding: 0px; 15 text-decoration: none; 16 } 17 html { 18 height: 100%; 19 margin-bottom: 1px; 20 } 21 #container { 22 width: 80%; 23 text-align: left; 24 background-color: #fff; 25 margin-right: auto; 26 margin-left: auto; 27 } 28 #header-container { 29 width: 100%; 30 padding-top: 15px; 31 } 32 #header-container h1, #header-container h2 { 33 margin-left: 6px; 34 margin-bottom: 6px; 35 } 36 .spacer { 37 width: 100%; 38 height: 15px; 39 } 40 hr { 41 border: 0px; 42 color: #ccc; 43 background-color: #cdcdcd; 44 height: 1px; 45 width: 100%; 46 text-align: left; 47 } 48 h1 { 49 font-size: 28px; 50 color: #c55; 51 background-color: #fff; 52 font-family: Arial, Verdana, sans-serif; 53 font-weight: 300; 54 } 55 h2 { 56 font-size: 15px; 57 color: #999; 58 font-family: Arial, Verdana, sans-serif; 59 font-weight: 300; 60 background-color: #fff; 61 } 62 h3 { 63 color: #4d9b12; 64 font-size: 15px; 65 text-align: left; 66 font-weight: 300; 67 padding: 5px; 68 margin-top: 5px; 69 } 70 71 #left-container { 72 float: left; 73 width: 250px; 74 background-color: #FFFFFF; 75 color: black; 76 } 77 78 #left-container h3 { 79 color: #c55; 80 } 81 82 #main-container { 83 margin: 5px 5px 5px 260px; 84 padding: 15px; 85 border-left: 1px solid silver; 86 min-height: 400px; 87 } 88 p { 89 color: #000; 90 background-color: #fff; 91 line-height: 20px; 92 padding: 5px; 93 } 94 a { 95 color: #4d9b12; 96 background-color: #fff; 97 text-decoration: none; 98 } 99 a:hover { 100 color: #4d9b12; 101 background-color: #fff; 102 text-decoration: underline; 103 } 104 #footer-container { 105 clear: both; 106 font-size: 12px; 107 font-family: Verdana, Arial, sans-serif; 108 } 109 .right { 110 float: right; 111 font-size: 100%; 112 margin-top: 5px; 113 color: #999; 114 background-color: #fff; 115 } 116 .left { 117 float: left; 118 font-size: 100%; 119 margin-top: 5px; 120 color: #999; 121 background-color: #fff; 122 } 123 #main-container ul { 124 margin-left: 3.0em; 125 } 126 </style> 6 <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8"> 127 7 </head> 128 8 <body> trunk/lib/merb/exceptions.rb
r479 r496 25 25 # 26 26 # The NotFound exception will look for a template at 27 # app/views/exceptions/not_found. erb27 # app/views/exceptions/not_found.html.erb 28 28 # If the template is not found then a simple message will be sent. 29 29 # trunk/lib/merb/mixins/view_context.rb
r438 r496 112 112 # 113 113 # ==== Examples 114 # # File: app/views/layouts/application.h erb114 # # File: app/views/layouts/application.html.erb 115 115 # 116 116 # <html> … … 199 199 # ==== Examples 200 200 # # my_action.herb has a call to require_js 'jquery' 201 # # File: layout/application.h erb201 # # File: layout/application.html.erb 202 202 # include_required_js 203 203 # # => <script src="/javascripts/jquery.js" type="text/javascript"></script> 204 204 # 205 205 # # my_action.herb has a call to require_js 'jquery', 'effects', 'validation' 206 # # File: layout/application.h erb206 # # File: layout/application.html.erb 207 207 # include_required_js 208 208 # # => <script src="/javascripts/jquery.js" type="text/javascript"></script> … … 219 219 # ==== Examples 220 220 # # my_action.herb has a call to require_css 'style' 221 # # File: layout/application.h erb221 # # File: layout/application.html.erb 222 222 # include_required_css 223 223 # # => <link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css"/> 224 224 # 225 225 # # my_action.herb has a call to require_js 'style', 'ie-specific' 226 # # File: layout/application.h erb226 # # File: layout/application.html.erb 227 227 # include_required_css 228 228 # # => <link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css"/> trunk/specs/merb/merb_generator_spec.rb
r453 r496 57 57 app/helpers/global_helper.rb 58 58 app/mailers/layout/application.erb 59 app/views/layout/application.h erb59 app/views/layout/application.html.erb 60 60 config/database.yml 61 61 config/environments/development.rb
