rails_layout 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.textile +8 -0
- data/README.textile +92 -8
- data/lib/generators/layout/templates/bootstrap2-application.html.erb +1 -0
- data/lib/generators/layout/templates/bootstrap2-messages.html.erb +1 -0
- data/lib/generators/layout/templates/bootstrap3-application.html.erb +46 -0
- data/lib/generators/layout/templates/bootstrap3-messages.html.erb +9 -0
- data/lib/generators/layout/templates/bootstrap3-navigation.html.erb +3 -0
- data/lib/generators/layout/templates/foundation4-application.html.erb +41 -0
- data/lib/generators/layout/templates/foundation4-messages.html.erb +9 -0
- data/lib/generators/layout/templates/foundation4-navigation.html.erb +3 -0
- data/lib/rails_layout/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ccb6085b59fb72a600fa3305f334b29292af235
|
4
|
+
data.tar.gz: f10cd4df4604be63a6811b6504e6fff6410a2adb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4f464d7c213ef3c57140f5a7c1de697fb37d85b069b82c101a052579a49b41c3ed613e68f975e8135cbc0576411d1ecc06a0860d8d86af324898b05332acddf
|
7
|
+
data.tar.gz: 73520aae0cf3f414f66231b8aeef99115ef5f1e924f898b5ab6be5721bcf2b32219524054a4138f7468ccc195223f574bd51c28203228303c0c9b0a0c35f4620
|
data/CHANGELOG.textile
CHANGED
data/README.textile
CHANGED
@@ -1,18 +1,35 @@
|
|
1
|
-
h1. !http://railsapps.github.io/images/rails-36x36.jpg(
|
1
|
+
h1. !http://railsapps.github.io/images/rails-36x36.jpg(RailsLayout Gem)! RailsLayout Gem
|
2
2
|
|
3
|
-
|
3
|
+
RailsLayout is a utility gem to use during development to set up a default application layout with partials for Rails flash messages and navigation links. It is a Rails generator that you add to your Rails application Gemfile.
|
4
4
|
|
5
|
-
|
5
|
+
You can generate layout files suitable for use with the following front-end frameworks:
|
6
|
+
|
7
|
+
* @simple@ - simple layout
|
8
|
+
* @bootstrap2@ - Twitter Bootstrap 2.3
|
9
|
+
* @bootstrap3@ - Twitter Bootstrap 3.0
|
10
|
+
* @foundation4@ - Zurb Foundation 4.0
|
11
|
+
|
12
|
+
The RailsLayout gem generates application layout files:
|
6
13
|
|
7
14
|
* app/views/layouts/application.html.erb
|
8
15
|
* app/views/layouts/_messages.html.erb
|
9
16
|
* app/views/layouts/_navigation.html.erb
|
10
17
|
|
11
|
-
|
18
|
+
Additionally, when the @simple@ option is selected:
|
12
19
|
|
13
|
-
*
|
14
|
-
|
15
|
-
|
20
|
+
* app/assets/stylesheets/simple.css
|
21
|
+
|
22
|
+
h2. Usage Example
|
23
|
+
|
24
|
+
To see how the RailsLayout gem is used in an application, see the "Learn Rails":https://github.com/RailsApps/learn-rails example application that is described in the book "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html.
|
25
|
+
|
26
|
+
!http://railsapps.github.io/images/learn-rails-cover-130x161.jpg(Learn Ruby on Rails)!:http://learn-rails.com/learn-ruby-on-rails.html
|
27
|
+
|
28
|
+
h2. Installing a Front-End Framework
|
29
|
+
|
30
|
+
Follow the "instructions for Twitter Bootstrap":http://railsapps.github.io/twitter-bootstrap-rails.html or "Zurb Foundation":http://foundation.zurb.com/docs/rails.html to install a front-end framework.
|
31
|
+
|
32
|
+
Then install the RailsLayout gem and generate layout files.
|
16
33
|
|
17
34
|
h2. Installation
|
18
35
|
|
@@ -24,6 +41,8 @@ group :development do
|
|
24
41
|
end
|
25
42
|
</pre>
|
26
43
|
|
44
|
+
You don't need the gem deployed to production, so put it in the @development@ group.
|
45
|
+
|
27
46
|
If you want to use a newer unreleased version from GitHub:
|
28
47
|
|
29
48
|
<pre>
|
@@ -38,7 +57,7 @@ Use Bundler to install the gem:
|
|
38
57
|
$ bundle install
|
39
58
|
</pre>
|
40
59
|
|
41
|
-
h2. Simple Layout
|
60
|
+
h2. Generate a Simple Layout
|
42
61
|
|
43
62
|
To create a set of simple layout files:
|
44
63
|
|
@@ -46,6 +65,19 @@ To create a set of simple layout files:
|
|
46
65
|
$ rails generate layout simple
|
47
66
|
</pre>
|
48
67
|
|
68
|
+
Use @--force@ if you want to overwrite existing files:
|
69
|
+
|
70
|
+
<pre>
|
71
|
+
$ rails generate layout simple --force
|
72
|
+
</pre>
|
73
|
+
|
74
|
+
See the files that are generated:
|
75
|
+
|
76
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-application.html.erb
|
77
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-messages.html.erb
|
78
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple-navigation.html.erb
|
79
|
+
* "app/assets/stylesheets/simple.css":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/simple.css
|
80
|
+
|
49
81
|
h2. Twitter Bootstrap 2.3 Layout
|
50
82
|
|
51
83
|
To create layout files for use with Twitter Bootstrap 2.3:
|
@@ -54,6 +86,58 @@ To create layout files for use with Twitter Bootstrap 2.3:
|
|
54
86
|
$ rails generate layout bootstrap2
|
55
87
|
</pre>
|
56
88
|
|
89
|
+
Use @--force@ if you want to overwrite existing files:
|
90
|
+
|
91
|
+
<pre>
|
92
|
+
$ rails generate layout bootstrap2 --force
|
93
|
+
</pre>
|
94
|
+
|
95
|
+
See the files that are generated:
|
96
|
+
|
97
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-application.html.erb
|
98
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-messages.html.erb
|
99
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap2-navigation.html.erb
|
100
|
+
|
101
|
+
h2. Twitter Bootstrap 3.0 Layout
|
102
|
+
|
103
|
+
To create layout files for use with Twitter Bootstrap 3.0:
|
104
|
+
|
105
|
+
<pre>
|
106
|
+
$ rails generate layout bootstrap3
|
107
|
+
</pre>
|
108
|
+
|
109
|
+
Use @--force@ if you want to overwrite existing files:
|
110
|
+
|
111
|
+
<pre>
|
112
|
+
$ rails generate layout bootstrap3 --force
|
113
|
+
</pre>
|
114
|
+
|
115
|
+
See the files that are generated:
|
116
|
+
|
117
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-application.html.erb
|
118
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-messages.html.erb
|
119
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/bootstrap3-navigation.html.erb
|
120
|
+
|
121
|
+
h2. Zurb Foundation 4.0 Layout
|
122
|
+
|
123
|
+
To create layout files for use with Zurb Foundation 4.0:
|
124
|
+
|
125
|
+
<pre>
|
126
|
+
$ rails generate layout foundation4
|
127
|
+
</pre>
|
128
|
+
|
129
|
+
Use @--force@ if you want to overwrite existing files:
|
130
|
+
|
131
|
+
<pre>
|
132
|
+
$ rails generate layout foundation4 --force
|
133
|
+
</pre>
|
134
|
+
|
135
|
+
See the files that are generated:
|
136
|
+
|
137
|
+
* "app/views/layouts/application.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-application.html.erb
|
138
|
+
* "app/views/layouts/_messages.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-messages.html.erb
|
139
|
+
* "app/views/layouts/_navigation.html.erb":https://github.com/RailsApps/rails_layout/blob/master/lib/generators/layout/templates/foundation4-navigation.html.erb
|
140
|
+
|
57
141
|
h2. Help
|
58
142
|
|
59
143
|
To see help messages:
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name.underscore.titleize %>" %></title>
|
6
|
+
<meta name="description" content="<%%= content_for?(:description) ? yield(:description) : "<%= app_name.underscore.titleize %>" %>">
|
7
|
+
<%%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
8
|
+
<%%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
9
|
+
<%%= csrf_meta_tags %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<%%# application layout styled for Twitter Bootstrap 3.0 %>
|
13
|
+
<header>
|
14
|
+
<nav class="navbar navbar-default navbar-fixed-top">
|
15
|
+
<div class="container">
|
16
|
+
<div class="navbar-header">
|
17
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
18
|
+
<span class="sr-only">Toggle navigation</span>
|
19
|
+
<span class="icon-bar"></span>
|
20
|
+
<span class="icon-bar"></span>
|
21
|
+
<span class="icon-bar"></span>
|
22
|
+
</button>
|
23
|
+
</div>
|
24
|
+
<div class="collapse navbar-collapse">
|
25
|
+
<%%= render 'layouts/navigation' %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</nav>
|
29
|
+
</header>
|
30
|
+
<main role="main">
|
31
|
+
<div class="container">
|
32
|
+
<div class="container">
|
33
|
+
<div class="content">
|
34
|
+
<div class="row">
|
35
|
+
<div class="col-md-12">
|
36
|
+
<%%= render 'layouts/messages' %>
|
37
|
+
<%%= yield %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<footer>
|
41
|
+
</footer>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</main>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%# Rails flash messages styled for Twitter Bootstrap 3.0 %>
|
2
|
+
<% flash.each do |name, msg| %>
|
3
|
+
<% if msg.is_a?(String) %>
|
4
|
+
<div class="alert alert-<%= name == :notice ? "success" : "danger" %>">
|
5
|
+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
6
|
+
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name.underscore.titleize %>" %></title>
|
6
|
+
<meta name="description" content="<%%= content_for?(:description) ? yield(:description) : "<%= app_name.underscore.titleize %>" %>">
|
7
|
+
<%%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
8
|
+
<%%# Modernizr is required for Zurb Foundation 4 %>
|
9
|
+
<%%= javascript_include_tag "vendor/custom.modernizr" %>
|
10
|
+
<%%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
11
|
+
<%%= csrf_meta_tags %>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<%%# application layout styled for Zurb Foundation 4 %>
|
15
|
+
<header>
|
16
|
+
<nav class="top-bar">
|
17
|
+
<ul class="title-area">
|
18
|
+
<li class="name"><!-- add site name or logo here --></li>
|
19
|
+
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
|
20
|
+
</ul>
|
21
|
+
<section class="top-bar-section">
|
22
|
+
<%%= render 'layouts/navigation' %>
|
23
|
+
</section>
|
24
|
+
</nav>
|
25
|
+
</header>
|
26
|
+
<main role="main">
|
27
|
+
<div class="container">
|
28
|
+
<div class="content">
|
29
|
+
<div class="row">
|
30
|
+
<div class="twelve columns">
|
31
|
+
<%%= render 'layouts/messages' %>
|
32
|
+
<%%= yield %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
<footer>
|
36
|
+
</footer>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</main>
|
40
|
+
</body>
|
41
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%# Rails flash messages styled for Zurb Foundation 4 %>
|
2
|
+
<% flash.each do |name, msg| %>
|
3
|
+
<% if msg.is_a?(String) %>
|
4
|
+
<div data-alert class="alert-box <%= name == :notice ? "warning" : "alert" %>">
|
5
|
+
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
6
|
+
<a href="#" class="close">×</a>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
data/lib/rails_layout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,6 +57,12 @@ files:
|
|
57
57
|
- lib/generators/layout/templates/bootstrap2-application.html.erb
|
58
58
|
- lib/generators/layout/templates/bootstrap2-messages.html.erb
|
59
59
|
- lib/generators/layout/templates/bootstrap2-navigation.html.erb
|
60
|
+
- lib/generators/layout/templates/bootstrap3-application.html.erb
|
61
|
+
- lib/generators/layout/templates/bootstrap3-messages.html.erb
|
62
|
+
- lib/generators/layout/templates/bootstrap3-navigation.html.erb
|
63
|
+
- lib/generators/layout/templates/foundation4-application.html.erb
|
64
|
+
- lib/generators/layout/templates/foundation4-messages.html.erb
|
65
|
+
- lib/generators/layout/templates/foundation4-navigation.html.erb
|
60
66
|
- lib/generators/layout/templates/simple-application.html.erb
|
61
67
|
- lib/generators/layout/templates/simple-messages.html.erb
|
62
68
|
- lib/generators/layout/templates/simple-navigation.html.erb
|