simple-bootstrap-forms 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffcc5003d54b531b2a2e6988fe50b51e03a93915c5f4305fcc79b077261920c3
|
4
|
+
data.tar.gz: 82d8919d3682b04711f21ef102490debe15424ee03d47c5f5e1156debd9a76e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a862a1b3f9b43c15ea8d77e676ce75ef9ca24414708dd604688a6c6d953b8ed37b9b8229c1e4b74af36de409f3b1233166dc9174e9f4415d53dc050cda69aaae
|
7
|
+
data.tar.gz: 3c3a445756c2c1758373a526da5c7ecc8d83fba58664f6558b2929197d9352fb5e0ac6dadf354fe0fa4b32a9863a1146455ae2d7f7fe6f6758533dbcb9af95d2
|
data/README.md
CHANGED
@@ -25,10 +25,11 @@ $ bundle install
|
|
25
25
|
$ rails g simple_bootstrap_forms
|
26
26
|
```
|
27
27
|
|
28
|
-
|
28
|
+
4 files will be generated:
|
29
29
|
|
30
30
|
- config/initializers/simple_boostrap_forms.rb (Config to suppress generating scaffold.scss)
|
31
31
|
- lib/templates/erb/scaffold/_form.html.erb (Simple override to the standard generator)
|
32
|
+
- lib/templates/erb/scaffold/index.html.erb (Simple override to the standard generator)
|
32
33
|
- app/views/shared/_error.html.erb (Shared error partial to keep code DRY)
|
33
34
|
|
34
35
|
## Contributing
|
@@ -14,4 +14,8 @@ class SimpleBootstrapFormsGenerator < Rails::Generators::Base
|
|
14
14
|
def copy_error_parial
|
15
15
|
copy_file '_error.html.erb', 'app/views/shared/_error.html.erb'
|
16
16
|
end
|
17
|
+
|
18
|
+
def copy_index_file
|
19
|
+
copy_file 'index.html.erb', 'lib/templates/erb/scaffold/index.html.erb'
|
20
|
+
end
|
17
21
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<p id="notice"><%%= notice %></p>
|
2
|
+
|
3
|
+
<h1><%= plural_table_name.titleize %></h1>
|
4
|
+
|
5
|
+
<table class='table'>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
9
|
+
<th scope="col"><%= attribute.human_name %></th>
|
10
|
+
<% end -%>
|
11
|
+
<th scope="col" colspan="3"></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
|
15
|
+
<tbody>
|
16
|
+
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
17
|
+
<tr>
|
18
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
19
|
+
<td><%%= <%= singular_table_name %>.<%= attribute.column_name %> %></td>
|
20
|
+
<% end -%>
|
21
|
+
<td><%%= link_to 'Show', <%= model_resource_name %> %></td>
|
22
|
+
<td><%%= link_to 'Edit', edit_<%= singular_route_name %>_path(<%= singular_table_name %>) %></td>
|
23
|
+
<td><%%= link_to 'Destroy', <%= model_resource_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
24
|
+
</tr>
|
25
|
+
<%% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
<br>
|
30
|
+
|
31
|
+
<%%= link_to 'New <%= singular_table_name.titleize %>', new_<%= singular_route_name %>_path %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-bootstrap-forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kress
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- lib/generators/simple_bootstrap_forms_generator.rb
|
38
38
|
- lib/generators/templates/_error.html.erb
|
39
39
|
- lib/generators/templates/_form.html.erb
|
40
|
+
- lib/generators/templates/index.html.erb
|
40
41
|
- lib/generators/templates/simple.rb
|
41
42
|
- lib/simple/bootstrap/forms.rb
|
42
43
|
- lib/simple/bootstrap/forms/railtie.rb
|