nu-generators 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/nu/templates/scaffold/controller.rb +2 -2
- data/lib/generators/nu/templates/scaffold/views/_form.html.erb +6 -6
- data/lib/generators/nu/templates/scaffold/views/edit.html.erb +1 -1
- data/lib/generators/nu/templates/scaffold/views/new.html.erb +1 -1
- data/lib/nu-generators/version.rb +1 -1
- metadata +2 -2
@@ -40,7 +40,7 @@ class <%= class_name.pluralize %>Controller < ApplicationController
|
|
40
40
|
format.html { redirect_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) }
|
41
41
|
format.json { render json: @<%= singular_table_name %>, status: :created, location: @<%= singular_table_name %> }
|
42
42
|
else
|
43
|
-
format.html { render
|
43
|
+
format.html { render "new" }
|
44
44
|
format.json { render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity }
|
45
45
|
end
|
46
46
|
end
|
@@ -54,7 +54,7 @@ class <%= class_name.pluralize %>Controller < ApplicationController
|
|
54
54
|
format.html { redirect_to all_<%= plural_table_name %>_path }
|
55
55
|
format.json { head :ok }
|
56
56
|
else
|
57
|
-
format.html { render
|
57
|
+
format.html { render "edit" }
|
58
58
|
format.json { render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity }
|
59
59
|
end
|
60
60
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%%= form_for(
|
2
|
-
<%%#= render 'form_messages', object:
|
1
|
+
<%%= form_for(<%= singular_table_name %>) do |f| %>
|
2
|
+
<%%#= render 'form_messages', object: <%= singular_table_name %> %>
|
3
3
|
|
4
4
|
<div class="field-group">
|
5
5
|
<%- attributes.each do |attribute| -%>
|
@@ -16,12 +16,12 @@
|
|
16
16
|
<%%= link_to "cancel", :back, <%= key_value :class, "'btn'" %> %>
|
17
17
|
</div>
|
18
18
|
|
19
|
-
<%%#= render 'status', object:
|
19
|
+
<%%#= render 'status', object: <%= singular_table_name %>, f: f %>
|
20
20
|
|
21
|
-
<%%- unless
|
21
|
+
<%%- unless <%= singular_table_name %>.new_record? -%>
|
22
22
|
<div class="field-group">
|
23
|
-
<%%= link_to "visualize",
|
24
|
-
<%%= link_to "remove",
|
23
|
+
<%%= link_to "visualize", <%= singular_table_name %>, <%= key_value :class, "'btn'" %> %>
|
24
|
+
<%%= link_to "remove", <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ confirm: 'Are you sure?' }" %>, <%= key_value :class, "'btn btn-danger'" %> %>
|
25
25
|
</div>
|
26
26
|
<%%- end -%>
|
27
27
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nu-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-11-
|
14
|
+
date: 2012-11-27 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: nu design custom generators
|
17
17
|
email:
|