style-guide 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +11 -0
- data/.gitmodules +3 -0
- data/.pairs +11 -0
- data/.rvmrc +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +144 -0
- data/Guardfile +14 -0
- data/LICENSE +7 -0
- data/README.md +7 -0
- data/Rakefile +27 -0
- data/app/assets/images/style_guide/.gitkeep +0 -0
- data/app/assets/images/style_guide/img/bird.png +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/app/assets/images/style_guide/img/browsers.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-bootstrap-features.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-masthead-pattern.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-responsive-illustrations.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-twitter-github.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-01.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-02.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-03.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/8020select.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/adoptahydrant.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/bartop.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/breakingnews.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/fleetio.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/gathercontent.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/jshint.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/kippt.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/railwayjs.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/soundready.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/totalwireframe.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-carousel.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-fluid.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-hero.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-marketing-narrow.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-signin.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-starter.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-sticky-footer.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-chrome.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-firefox.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-safari.png +0 -0
- data/app/assets/images/style_guide/img/examples/slide-01.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/slide-02.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/slide-03.jpg +0 -0
- data/app/assets/images/style_guide/img/github-16px.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_042_group.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons-halflings.png +0 -0
- data/app/assets/images/style_guide/img/grid-18px-masked.png +0 -0
- data/app/assets/images/style_guide/img/grid-baseline-20px.png +0 -0
- data/app/assets/images/style_guide/img/icon-css3.png +0 -0
- data/app/assets/images/style_guide/img/icon-github.png +0 -0
- data/app/assets/images/style_guide/img/icon-html5.png +0 -0
- data/app/assets/images/style_guide/img/icon-twitter.png +0 -0
- data/app/assets/images/style_guide/img/less-logo-large.png +0 -0
- data/app/assets/images/style_guide/img/less-small.png +0 -0
- data/app/assets/images/style_guide/img/responsive-illustrations.png +0 -0
- data/app/assets/javascripts/style_guide/application.js +13 -0
- data/app/assets/javascripts/style_guide/docs.js +154 -0
- data/app/assets/javascripts/style_guide/prettify.js +28 -0
- data/app/assets/stylesheets/style_guide/application.css +13 -0
- data/app/assets/stylesheets/style_guide/docs.css +1015 -0
- data/app/assets/stylesheets/style_guide/prettify.css +30 -0
- data/app/controllers/style_guide/application_controller.rb +4 -0
- data/app/controllers/style_guide/style_controller.rb +12 -0
- data/app/helpers/style_guide/application_helper.rb +4 -0
- data/app/views/layouts/style_guide/application.html.erb +44 -0
- data/app/views/style_guide/partials/_buttons.erb +167 -0
- data/app/views/style_guide/partials/_code.erb +31 -0
- data/app/views/style_guide/partials/_forms.erb +714 -0
- data/app/views/style_guide/partials/_images.erb +318 -0
- data/app/views/style_guide/partials/_tables.erb +409 -0
- data/app/views/style_guide/partials/_typography.erb +331 -0
- data/app/views/style_guide/style/index.html.erb +32 -0
- data/config/routes.rb +3 -0
- data/lib/style_guide/engine.rb +12 -0
- data/lib/style_guide/version.rb +3 -0
- data/lib/style_guide.rb +4 -0
- data/script/rails +8 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_042_group.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons-halflings-white.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons-halflings.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +27 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-affix.js +106 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-alert.js +88 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-button.js +94 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-carousel.js +176 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-collapse.js +156 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-dropdown.js +148 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-modal.js +234 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-popover.js +103 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-scrollspy.js +151 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-tab.js +133 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-tooltip.js +276 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-transition.js +60 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-typeahead.js +310 -0
- data/spec/dummy/app/assets/javascripts/jquery.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/accordion.less +34 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/alerts.less +65 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/bootstrap.less +63 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/breadcrumbs.less +24 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/button-groups.less +242 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/buttons.less +232 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/carousel.less +131 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/close.less +31 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/code.less +58 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/component-animations.less +22 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/dropdowns.less +237 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/forms.less +683 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/grid.less +21 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/hero-unit.less +25 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/labels-badges.less +74 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/layouts.less +16 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/media.less +55 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/mixins.less +687 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/modals.less +94 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/navbar.less +475 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/navs.less +385 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/pager.less +41 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/pagination.less +121 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/popovers.less +117 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/progress-bars.less +122 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/reset.less +138 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-1200px-min.less +28 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-767px-max.less +193 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-768px-979px.less +19 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-navbar.less +185 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-utilities.less +43 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive.less +48 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/scaffolding.less +52 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/sprites.less +193 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/tables.less +236 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/thumbnails.less +52 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/tooltip.less +70 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/type.less +227 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/utilities.less +30 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/variables.less +301 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/wells.less +29 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap-responsive.css +1088 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap.css +5893 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/_colors.scss +10 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/ars-maquette-web.css +35 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/button.less +5 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/layout.css.scss +11 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/typography.css.scss +20 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/variables.css.less +10 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap.css.less +3 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/home_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/home/index.html.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/styles/_info-header.erb +1 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +34 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_042_group.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/spec/dummy/public/img/glyphicons-halflings-white.png +0 -0
- data/spec/dummy/public/img/glyphicons-halflings.png +0 -0
- data/spec/dummy/script/rails +6 -0
- data/style-guide.gemspec +26 -0
- metadata +500 -0
@@ -0,0 +1,331 @@
|
|
1
|
+
<!-- Typography
|
2
|
+
================================================== -->
|
3
|
+
<section id="typography">
|
4
|
+
<div class="page-header">
|
5
|
+
<h1>Typography</h1>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
|
9
|
+
<h2 id="headings">Headings</h2>
|
10
|
+
<p>All HTML headings, <code><h1></code> through <code><h6></code> are available.</p>
|
11
|
+
<div class="bs-docs-example">
|
12
|
+
<h1>h1. Heading 1</h1>
|
13
|
+
<h2>h2. Heading 2</h2>
|
14
|
+
<h3>h3. Heading 3</h3>
|
15
|
+
<h4>h4. Heading 4</h4>
|
16
|
+
<h5>h5. Heading 5</h5>
|
17
|
+
<h6>h6. Heading 6</h6>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
|
21
|
+
<h2 id="body-copy">Body copy</h2>
|
22
|
+
<p>Bootstrap's global default <code>font-size</code> is <strong>14px</strong>, with a <code>line-height</code> of <strong>20px</strong>. This is applied to the <code><body></code> and all paragraphs. In addition, <code><p></code> (paragraphs) receive a bottom margin of half their line-height (10px by default).</p>
|
23
|
+
<div class="bs-docs-example">
|
24
|
+
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.</p>
|
25
|
+
<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
26
|
+
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
|
27
|
+
</div>
|
28
|
+
<pre class="prettyprint"><p>...</p></pre>
|
29
|
+
|
30
|
+
|
31
|
+
<h3>Lead body copy</h3>
|
32
|
+
<p>Make a paragraph stand out by adding <code>.lead</code>.</p>
|
33
|
+
<div class="bs-docs-example">
|
34
|
+
<p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p>
|
35
|
+
</div>
|
36
|
+
<pre class="prettyprint"><p class="lead">...</p></pre>
|
37
|
+
|
38
|
+
|
39
|
+
<h3>Built with Less</h3>
|
40
|
+
<p>The typographic scale is based on two LESS variables in <strong>variables.less</strong>: <code>@baseFontSize</code> and <code>@baseLineHeight</code>. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.</p>
|
41
|
+
|
42
|
+
|
43
|
+
<hr class="bs-docs-separator">
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<h2 id="emphasis">Emphasis</h2>
|
48
|
+
<p>Make use of HTML's default emphasis tags with lightweight styles.</p>
|
49
|
+
|
50
|
+
<h3><code><small></code></h3>
|
51
|
+
<p>For de-emphasizing inline or blocks of text, <small>use the small tag.</small></p>
|
52
|
+
<div class="bs-docs-example">
|
53
|
+
<p><small>This line of text is meant to be treated as fine print.</small></p>
|
54
|
+
</div>
|
55
|
+
<pre class="prettyprint">
|
56
|
+
<p>
|
57
|
+
<small>This line of text is meant to be treated as fine print.</small>
|
58
|
+
</p>
|
59
|
+
</pre>
|
60
|
+
|
61
|
+
<h3>Bold</h3>
|
62
|
+
<p>For emphasizing a snippet of text with a heavier font-weight.</p>
|
63
|
+
<div class="bs-docs-example">
|
64
|
+
<p>The following snippet of text is <strong>rendered as bold text</strong>.</p>
|
65
|
+
</div>
|
66
|
+
<pre class="prettyprint"><strong>rendered as bold text</strong></pre>
|
67
|
+
|
68
|
+
<h3>Italics</h3>
|
69
|
+
<p>For emphasizing a snippet of text with italics.</p>
|
70
|
+
<div class="bs-docs-example">
|
71
|
+
<p>The following snippet of text is <em>rendered as italicized text</em>.</p>
|
72
|
+
</div>
|
73
|
+
<pre class="prettyprint"><em>rendered as italicized text</em></pre>
|
74
|
+
|
75
|
+
<p><span class="label label-info">Heads up!</span> Feel free to use <code><b></code> and <code><i></code> in HTML5. <code><b></code> is meant to highlight words or phrases without conveying additional importance while <code><i></code> is mostly for voice, technical terms, etc.</p>
|
76
|
+
|
77
|
+
<h3>Emphasis classes</h3>
|
78
|
+
<p>Convey meaning through color with a handful of emphasis utility classes.</p>
|
79
|
+
<div class="bs-docs-example">
|
80
|
+
<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
|
81
|
+
<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
|
82
|
+
<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
|
83
|
+
<p class="text-info">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.</p>
|
84
|
+
<p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
|
85
|
+
</div>
|
86
|
+
<pre class="prettyprint linenums">
|
87
|
+
<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
|
88
|
+
<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
|
89
|
+
<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
|
90
|
+
<p class="text-info">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.</p>
|
91
|
+
<p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
|
92
|
+
</pre>
|
93
|
+
|
94
|
+
|
95
|
+
<hr class="bs-docs-separator">
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<h2 id="abbreviations">Abbreviations</h2>
|
100
|
+
<p>Stylized implemenation of HTML's <code><abbr></code> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.</p>
|
101
|
+
|
102
|
+
<h3><code><abbr></code></h3>
|
103
|
+
<p>For expanded text on long hover of an abbreviation, include the <code>title</code> attribute.</p>
|
104
|
+
<div class="bs-docs-example">
|
105
|
+
<p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p>
|
106
|
+
</div>
|
107
|
+
<pre class="prettyprint"><abbr title="attribute">attr</abbr></pre>
|
108
|
+
|
109
|
+
<h3><code><abbr class="initialism"></code></h3>
|
110
|
+
<p>Add <code>.initialism</code> to an abbreviation for a slightly smaller font-size.</p>
|
111
|
+
<div class="bs-docs-example">
|
112
|
+
<p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.</p>
|
113
|
+
</div>
|
114
|
+
<pre class="prettyprint"><abbr title="HyperText Markup Language" class="initialism">HTML</abbr></pre>
|
115
|
+
|
116
|
+
|
117
|
+
<hr class="bs-docs-separator">
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2 id="addresses">Addresses</h2>
|
122
|
+
<p>Present contact information for the nearest ancestor or the entire body of work.</p>
|
123
|
+
|
124
|
+
<h3><code><address></code></h3>
|
125
|
+
<p>Preserve formatting by ending all lines with <code><br></code>.</p>
|
126
|
+
<div class="bs-docs-example">
|
127
|
+
<address>
|
128
|
+
<strong>Twitter, Inc.</strong><br>
|
129
|
+
795 Folsom Ave, Suite 600<br>
|
130
|
+
San Francisco, CA 94107<br>
|
131
|
+
<abbr title="Phone">P:</abbr> (123) 456-7890
|
132
|
+
</address>
|
133
|
+
<address>
|
134
|
+
<strong>Full Name</strong><br>
|
135
|
+
<a href="mailto:#">first.last@gmail.com</a>
|
136
|
+
</address>
|
137
|
+
</div>
|
138
|
+
<pre class="prettyprint linenums">
|
139
|
+
<address>
|
140
|
+
<strong>Twitter, Inc.</strong><br>
|
141
|
+
795 Folsom Ave, Suite 600<br>
|
142
|
+
San Francisco, CA 94107<br>
|
143
|
+
<abbr title="Phone">P:</abbr> (123) 456-7890
|
144
|
+
</address>
|
145
|
+
|
146
|
+
<address>
|
147
|
+
<strong>Full Name</strong><br>
|
148
|
+
<a href="mailto:#">first.last@gmail.com</a>
|
149
|
+
</address>
|
150
|
+
</pre>
|
151
|
+
|
152
|
+
|
153
|
+
<hr class="bs-docs-separator">
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<h2 id="blockquotes">Blockquotes</h2>
|
158
|
+
<p>For quoting blocks of content from another source within your document.</p>
|
159
|
+
|
160
|
+
<h3>Default blockquote</h3>
|
161
|
+
<p>Wrap <code><blockquote></code> around any <abbr title="HyperText Markup Language">HTML</abbr> as the quote. For straight quotes we recommend a <code><p></code>.</p>
|
162
|
+
<div class="bs-docs-example">
|
163
|
+
<blockquote>
|
164
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
165
|
+
</blockquote>
|
166
|
+
</div>
|
167
|
+
<pre class="prettyprint linenums">
|
168
|
+
<blockquote>
|
169
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
170
|
+
</blockquote>
|
171
|
+
</pre>
|
172
|
+
|
173
|
+
<h3>Blockquote options</h3>
|
174
|
+
<p>Style and content changes for simple variations on a standard blockquote.</p>
|
175
|
+
|
176
|
+
<h4>Naming a source</h4>
|
177
|
+
<p>Add <code><small></code> tag for identifying the source. Wrap the name of the source work in <code><cite></code>.</p>
|
178
|
+
<div class="bs-docs-example">
|
179
|
+
<blockquote>
|
180
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
181
|
+
<small>Someone famous in <cite title="Source Title">Source Title</cite></small>
|
182
|
+
</blockquote>
|
183
|
+
</div>
|
184
|
+
<pre class="prettyprint linenums">
|
185
|
+
<blockquote>
|
186
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
187
|
+
<small>Someone famous <cite title="Source Title">Source Title</cite></small>
|
188
|
+
</blockquote>
|
189
|
+
</pre>
|
190
|
+
|
191
|
+
<h4>Alternate displays</h4>
|
192
|
+
<p>Use <code>.pull-right</code> for a floated, right-aligned blockquote.</p>
|
193
|
+
<div class="bs-docs-example" style="overflow: hidden;">
|
194
|
+
<blockquote class="pull-right">
|
195
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
196
|
+
<small>Someone famous in <cite title="Source Title">Source Title</cite></small>
|
197
|
+
</blockquote>
|
198
|
+
</div>
|
199
|
+
<pre class="prettyprint linenums">
|
200
|
+
<blockquote class="pull-right">
|
201
|
+
...
|
202
|
+
</blockquote>
|
203
|
+
</pre>
|
204
|
+
|
205
|
+
|
206
|
+
<hr class="bs-docs-separator">
|
207
|
+
|
208
|
+
|
209
|
+
<!-- Lists -->
|
210
|
+
<h2 id="lists">Lists</h2>
|
211
|
+
|
212
|
+
<h3>Unordered</h3>
|
213
|
+
<p>A list of items in which the order does <em>not</em> explicitly matter.</p>
|
214
|
+
<div class="bs-docs-example">
|
215
|
+
<ul>
|
216
|
+
<li>Lorem ipsum dolor sit amet</li>
|
217
|
+
<li>Consectetur adipiscing elit</li>
|
218
|
+
<li>Integer molestie lorem at massa</li>
|
219
|
+
<li>Facilisis in pretium nisl aliquet</li>
|
220
|
+
<li>Nulla volutpat aliquam velit
|
221
|
+
<ul>
|
222
|
+
<li>Phasellus iaculis neque</li>
|
223
|
+
<li>Purus sodales ultricies</li>
|
224
|
+
<li>Vestibulum laoreet porttitor sem</li>
|
225
|
+
<li>Ac tristique libero volutpat at</li>
|
226
|
+
</ul>
|
227
|
+
</li>
|
228
|
+
<li>Faucibus porta lacus fringilla vel</li>
|
229
|
+
<li>Aenean sit amet erat nunc</li>
|
230
|
+
<li>Eget porttitor lorem</li>
|
231
|
+
</ul>
|
232
|
+
</div>
|
233
|
+
<pre class="prettyprint linenums">
|
234
|
+
<ul>
|
235
|
+
<li>...</li>
|
236
|
+
</ul>
|
237
|
+
</pre>
|
238
|
+
|
239
|
+
<h3>Ordered</h3>
|
240
|
+
<p>A list of items in which the order <em>does</em> explicitly matter.</p>
|
241
|
+
<div class="bs-docs-example">
|
242
|
+
<ol>
|
243
|
+
<li>Lorem ipsum dolor sit amet</li>
|
244
|
+
<li>Consectetur adipiscing elit</li>
|
245
|
+
<li>Integer molestie lorem at massa</li>
|
246
|
+
<li>Facilisis in pretium nisl aliquet</li>
|
247
|
+
<li>Nulla volutpat aliquam velit</li>
|
248
|
+
<li>Faucibus porta lacus fringilla vel</li>
|
249
|
+
<li>Aenean sit amet erat nunc</li>
|
250
|
+
<li>Eget porttitor lorem</li>
|
251
|
+
</ol>
|
252
|
+
</div>
|
253
|
+
<pre class="prettyprint linenums">
|
254
|
+
<ol>
|
255
|
+
<li>...</li>
|
256
|
+
</ol>
|
257
|
+
</pre>
|
258
|
+
|
259
|
+
<h3>Unstyled</h3>
|
260
|
+
<p>A list of items with no <code>list-style</code> or additional left padding.</p>
|
261
|
+
<div class="bs-docs-example">
|
262
|
+
<ul class="unstyled">
|
263
|
+
<li>Lorem ipsum dolor sit amet</li>
|
264
|
+
<li>Consectetur adipiscing elit</li>
|
265
|
+
<li>Integer molestie lorem at massa</li>
|
266
|
+
<li>Facilisis in pretium nisl aliquet</li>
|
267
|
+
<li>Nulla volutpat aliquam velit
|
268
|
+
<ul>
|
269
|
+
<li>Phasellus iaculis neque</li>
|
270
|
+
<li>Purus sodales ultricies</li>
|
271
|
+
<li>Vestibulum laoreet porttitor sem</li>
|
272
|
+
<li>Ac tristique libero volutpat at</li>
|
273
|
+
</ul>
|
274
|
+
</li>
|
275
|
+
<li>Faucibus porta lacus fringilla vel</li>
|
276
|
+
<li>Aenean sit amet erat nunc</li>
|
277
|
+
<li>Eget porttitor lorem</li>
|
278
|
+
</ul>
|
279
|
+
</div>
|
280
|
+
<pre class="prettyprint linenums">
|
281
|
+
<ul class="unstyled">
|
282
|
+
<li>...</li>
|
283
|
+
</ul>
|
284
|
+
</pre>
|
285
|
+
|
286
|
+
<h3>Description</h3>
|
287
|
+
<p>A list of terms with their associated descriptions.</p>
|
288
|
+
<div class="bs-docs-example">
|
289
|
+
<dl>
|
290
|
+
<dt>Description lists</dt>
|
291
|
+
<dd>A description list is perfect for defining terms.</dd>
|
292
|
+
<dt>Euismod</dt>
|
293
|
+
<dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd>
|
294
|
+
<dd>Donec id elit non mi porta gravida at eget metus.</dd>
|
295
|
+
<dt>Malesuada porta</dt>
|
296
|
+
<dd>Etiam porta sem malesuada magna mollis euismod.</dd>
|
297
|
+
</dl>
|
298
|
+
</div>
|
299
|
+
<pre class="prettyprint linenums">
|
300
|
+
<dl>
|
301
|
+
<dt>...</dt>
|
302
|
+
<dd>...</dd>
|
303
|
+
</dl>
|
304
|
+
</pre>
|
305
|
+
|
306
|
+
<h4>Horizontal description</h4>
|
307
|
+
<p>Make terms and descriptions in <code><dl></code> line up side-by-side.</p>
|
308
|
+
<div class="bs-docs-example">
|
309
|
+
<dl class="dl-horizontal">
|
310
|
+
<dt>Description lists</dt>
|
311
|
+
<dd>A description list is perfect for defining terms.</dd>
|
312
|
+
<dt>Euismod</dt>
|
313
|
+
<dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd>
|
314
|
+
<dd>Donec id elit non mi porta gravida at eget metus.</dd>
|
315
|
+
<dt>Malesuada porta</dt>
|
316
|
+
<dd>Etiam porta sem malesuada magna mollis euismod.</dd>
|
317
|
+
<dt>Felis euismod semper eget lacinia</dt>
|
318
|
+
<dd>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</dd>
|
319
|
+
</dl>
|
320
|
+
</div>
|
321
|
+
<pre class="prettyprint linenums">
|
322
|
+
<dl class="dl-horizontal">
|
323
|
+
<dt>...</dt>
|
324
|
+
<dd>...</dd>
|
325
|
+
</dl>
|
326
|
+
</pre>
|
327
|
+
<p>
|
328
|
+
<span class="label label-info">Heads up!</span>
|
329
|
+
Horizontal description lists will truncate terms that are too long to fit in the left column fix <code>text-overflow</code>. In narrower viewports, they will change to the default stacked layout.
|
330
|
+
</p>
|
331
|
+
</section>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<!-- Subhead
|
2
|
+
================================================== -->
|
3
|
+
<header class="jumbotron subhead" id="overview">
|
4
|
+
<div class="container">
|
5
|
+
<h1>Base CSS</h1>
|
6
|
+
<p class="lead">Fundamental HTML elements styled and enhanced with extensible classes.</p>
|
7
|
+
</div>
|
8
|
+
</header>
|
9
|
+
|
10
|
+
|
11
|
+
<div class="container">
|
12
|
+
<!-- Docs nav
|
13
|
+
================================================== -->
|
14
|
+
<div class="row">
|
15
|
+
<div class="span3 bs-docs-sidebar">
|
16
|
+
<ul class="nav nav-list bs-docs-sidenav">
|
17
|
+
<li><a href="#typography"><i class="icon-chevron-right"></i> Typography</a></li>
|
18
|
+
<li><a href="#code"><i class="icon-chevron-right"></i> Code</a></li>
|
19
|
+
<li><a href="#tables"><i class="icon-chevron-right"></i> Tables</a></li>
|
20
|
+
<li><a href="#forms"><i class="icon-chevron-right"></i> Forms</a></li>
|
21
|
+
<li><a href="#buttons"><i class="icon-chevron-right"></i> Buttons</a></li>
|
22
|
+
<li><a href="#images"><i class="icon-chevron-right"></i> Images</a></li>
|
23
|
+
<li><a href="#icons"><i class="icon-chevron-right"></i> Icons by Glyphicons</a></li>
|
24
|
+
</ul>
|
25
|
+
</div>
|
26
|
+
<div class="span9">
|
27
|
+
<% @partials.each do |partial| %>
|
28
|
+
<%= render :file => partial %>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module StyleGuide
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace StyleGuide
|
4
|
+
class StyleGuideConfig < Struct.new(:partial_paths); end
|
5
|
+
|
6
|
+
config.style_guide = StyleGuideConfig.new([])
|
7
|
+
|
8
|
+
initializer "style_guide.set_up_variables", :before => :load_config_initializers do |app|
|
9
|
+
app.config.style_guide.partial_paths << StyleGuide::Engine.root.join("app/views/style_guide/partials")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/style_guide.rb
ADDED
data/script/rails
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/style_guide/engine', __FILE__)
|
6
|
+
|
7
|
+
require 'rails/all'
|
8
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,261 @@
|
|
1
|
+
== Welcome to Rails
|
2
|
+
|
3
|
+
Rails is a web-application framework that includes everything needed to create
|
4
|
+
database-backed web applications according to the Model-View-Control pattern.
|
5
|
+
|
6
|
+
This pattern splits the view (also called the presentation) into "dumb"
|
7
|
+
templates that are primarily responsible for inserting pre-built data in between
|
8
|
+
HTML tags. The model contains the "smart" domain objects (such as Account,
|
9
|
+
Product, Person, Post) that holds all the business logic and knows how to
|
10
|
+
persist themselves to a database. The controller handles the incoming requests
|
11
|
+
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
12
|
+
and directing data to the view.
|
13
|
+
|
14
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
15
|
+
layer entitled Active Record. This layer allows you to present the data from
|
16
|
+
database rows as objects and embellish these data objects with business logic
|
17
|
+
methods. You can read more about Active Record in
|
18
|
+
link:files/vendor/rails/activerecord/README.html.
|
19
|
+
|
20
|
+
The controller and view are handled by the Action Pack, which handles both
|
21
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
+
are bundled in a single package due to their heavy interdependence. This is
|
23
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
+
more separate. Each of these packages can be used independently outside of
|
25
|
+
Rails. You can read more about Action Pack in
|
26
|
+
link:files/vendor/rails/actionpack/README.html.
|
27
|
+
|
28
|
+
|
29
|
+
== Getting Started
|
30
|
+
|
31
|
+
1. At the command prompt, create a new Rails application:
|
32
|
+
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
|
33
|
+
|
34
|
+
2. Change directory to <tt>myapp</tt> and start the web server:
|
35
|
+
<tt>cd myapp; rails server</tt> (run with --help for options)
|
36
|
+
|
37
|
+
3. Go to http://localhost:3000/ and you'll see:
|
38
|
+
"Welcome aboard: You're riding Ruby on Rails!"
|
39
|
+
|
40
|
+
4. Follow the guidelines to start developing your application. You can find
|
41
|
+
the following resources handy:
|
42
|
+
|
43
|
+
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
|
44
|
+
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
|
45
|
+
|
46
|
+
|
47
|
+
== Debugging Rails
|
48
|
+
|
49
|
+
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
50
|
+
will help you debug it and get it back on the rails.
|
51
|
+
|
52
|
+
First area to check is the application log files. Have "tail -f" commands
|
53
|
+
running on the server.log and development.log. Rails will automatically display
|
54
|
+
debugging and runtime information to these files. Debugging info will also be
|
55
|
+
shown in the browser on requests from 127.0.0.1.
|
56
|
+
|
57
|
+
You can also log your own messages directly into the log file from your code
|
58
|
+
using the Ruby logger class from inside your controllers. Example:
|
59
|
+
|
60
|
+
class WeblogController < ActionController::Base
|
61
|
+
def destroy
|
62
|
+
@weblog = Weblog.find(params[:id])
|
63
|
+
@weblog.destroy
|
64
|
+
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
The result will be a message in your log file along the lines of:
|
69
|
+
|
70
|
+
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
|
71
|
+
|
72
|
+
More information on how to use the logger is at http://www.ruby-doc.org/core/
|
73
|
+
|
74
|
+
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
|
75
|
+
several books available online as well:
|
76
|
+
|
77
|
+
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
|
78
|
+
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
|
79
|
+
|
80
|
+
These two books will bring you up to speed on the Ruby language and also on
|
81
|
+
programming in general.
|
82
|
+
|
83
|
+
|
84
|
+
== Debugger
|
85
|
+
|
86
|
+
Debugger support is available through the debugger command when you start your
|
87
|
+
Mongrel or WEBrick server with --debugger. This means that you can break out of
|
88
|
+
execution at any point in the code, investigate and change the model, and then,
|
89
|
+
resume execution! You need to install ruby-debug to run the server in debugging
|
90
|
+
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
91
|
+
|
92
|
+
class WeblogController < ActionController::Base
|
93
|
+
def index
|
94
|
+
@posts = Post.all
|
95
|
+
debugger
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
So the controller will accept the action, run the first line, then present you
|
100
|
+
with a IRB prompt in the server window. Here you can do things like:
|
101
|
+
|
102
|
+
>> @posts.inspect
|
103
|
+
=> "[#<Post:0x14a6be8
|
104
|
+
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
|
105
|
+
#<Post:0x14a6620
|
106
|
+
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
|
107
|
+
>> @posts.first.title = "hello from a debugger"
|
108
|
+
=> "hello from a debugger"
|
109
|
+
|
110
|
+
...and even better, you can examine how your runtime objects actually work:
|
111
|
+
|
112
|
+
>> f = @posts.first
|
113
|
+
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
114
|
+
>> f.
|
115
|
+
Display all 152 possibilities? (y or n)
|
116
|
+
|
117
|
+
Finally, when you're ready to resume execution, you can enter "cont".
|
118
|
+
|
119
|
+
|
120
|
+
== Console
|
121
|
+
|
122
|
+
The console is a Ruby shell, which allows you to interact with your
|
123
|
+
application's domain model. Here you'll have all parts of the application
|
124
|
+
configured, just like it is when the application is running. You can inspect
|
125
|
+
domain models, change values, and save to the database. Starting the script
|
126
|
+
without arguments will launch it in the development environment.
|
127
|
+
|
128
|
+
To start the console, run <tt>rails console</tt> from the application
|
129
|
+
directory.
|
130
|
+
|
131
|
+
Options:
|
132
|
+
|
133
|
+
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
|
134
|
+
made to the database.
|
135
|
+
* Passing an environment name as an argument will load the corresponding
|
136
|
+
environment. Example: <tt>rails console production</tt>.
|
137
|
+
|
138
|
+
To reload your controllers and models after launching the console run
|
139
|
+
<tt>reload!</tt>
|
140
|
+
|
141
|
+
More information about irb can be found at:
|
142
|
+
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
|
+
|
144
|
+
|
145
|
+
== dbconsole
|
146
|
+
|
147
|
+
You can go to the command line of your database directly through <tt>rails
|
148
|
+
dbconsole</tt>. You would be connected to the database with the credentials
|
149
|
+
defined in database.yml. Starting the script without arguments will connect you
|
150
|
+
to the development database. Passing an argument will connect you to a different
|
151
|
+
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
|
152
|
+
PostgreSQL and SQLite 3.
|
153
|
+
|
154
|
+
== Description of Contents
|
155
|
+
|
156
|
+
The default directory structure of a generated Ruby on Rails application:
|
157
|
+
|
158
|
+
|-- app
|
159
|
+
| |-- assets
|
160
|
+
| |-- images
|
161
|
+
| |-- javascripts
|
162
|
+
| `-- stylesheets
|
163
|
+
| |-- controllers
|
164
|
+
| |-- helpers
|
165
|
+
| |-- mailers
|
166
|
+
| |-- models
|
167
|
+
| `-- views
|
168
|
+
| `-- layouts
|
169
|
+
|-- config
|
170
|
+
| |-- environments
|
171
|
+
| |-- initializers
|
172
|
+
| `-- locales
|
173
|
+
|-- db
|
174
|
+
|-- doc
|
175
|
+
|-- lib
|
176
|
+
| `-- tasks
|
177
|
+
|-- log
|
178
|
+
|-- public
|
179
|
+
|-- script
|
180
|
+
|-- test
|
181
|
+
| |-- fixtures
|
182
|
+
| |-- functional
|
183
|
+
| |-- integration
|
184
|
+
| |-- performance
|
185
|
+
| `-- unit
|
186
|
+
|-- tmp
|
187
|
+
| |-- cache
|
188
|
+
| |-- pids
|
189
|
+
| |-- sessions
|
190
|
+
| `-- sockets
|
191
|
+
`-- vendor
|
192
|
+
|-- assets
|
193
|
+
`-- stylesheets
|
194
|
+
`-- plugins
|
195
|
+
|
196
|
+
app
|
197
|
+
Holds all the code that's specific to this particular application.
|
198
|
+
|
199
|
+
app/assets
|
200
|
+
Contains subdirectories for images, stylesheets, and JavaScript files.
|
201
|
+
|
202
|
+
app/controllers
|
203
|
+
Holds controllers that should be named like weblogs_controller.rb for
|
204
|
+
automated URL mapping. All controllers should descend from
|
205
|
+
ApplicationController which itself descends from ActionController::Base.
|
206
|
+
|
207
|
+
app/models
|
208
|
+
Holds models that should be named like post.rb. Models descend from
|
209
|
+
ActiveRecord::Base by default.
|
210
|
+
|
211
|
+
app/views
|
212
|
+
Holds the template files for the view that should be named like
|
213
|
+
weblogs/index.html.erb for the WeblogsController#index action. All views use
|
214
|
+
eRuby syntax by default.
|
215
|
+
|
216
|
+
app/views/layouts
|
217
|
+
Holds the template files for layouts to be used with views. This models the
|
218
|
+
common header/footer method of wrapping views. In your views, define a layout
|
219
|
+
using the <tt>layout :default</tt> and create a file named default.html.erb.
|
220
|
+
Inside default.html.erb, call <% yield %> to render the view using this
|
221
|
+
layout.
|
222
|
+
|
223
|
+
app/helpers
|
224
|
+
Holds view helpers that should be named like weblogs_helper.rb. These are
|
225
|
+
generated for you automatically when using generators for controllers.
|
226
|
+
Helpers can be used to wrap functionality for your views into methods.
|
227
|
+
|
228
|
+
config
|
229
|
+
Configuration files for the Rails environment, the routing map, the database,
|
230
|
+
and other dependencies.
|
231
|
+
|
232
|
+
db
|
233
|
+
Contains the database schema in schema.rb. db/migrate contains all the
|
234
|
+
sequence of Migrations for your schema.
|
235
|
+
|
236
|
+
doc
|
237
|
+
This directory is where your application documentation will be stored when
|
238
|
+
generated using <tt>rake doc:app</tt>
|
239
|
+
|
240
|
+
lib
|
241
|
+
Application specific libraries. Basically, any kind of custom code that
|
242
|
+
doesn't belong under controllers, models, or helpers. This directory is in
|
243
|
+
the load path.
|
244
|
+
|
245
|
+
public
|
246
|
+
The directory available for the web server. Also contains the dispatchers and the
|
247
|
+
default HTML files. This should be set as the DOCUMENT_ROOT of your web
|
248
|
+
server.
|
249
|
+
|
250
|
+
script
|
251
|
+
Helper scripts for automation and generation.
|
252
|
+
|
253
|
+
test
|
254
|
+
Unit and functional tests along with fixtures. When using the rails generate
|
255
|
+
command, template test files will be generated for you and placed in this
|
256
|
+
directory.
|
257
|
+
|
258
|
+
vendor
|
259
|
+
External libraries that the application depends on. Also includes the plugins
|
260
|
+
subdirectory. If the app has frozen rails, those gems also go here, under
|
261
|
+
vendor/rails/. This directory is in the load path.
|