hot-glue 0.5.15 → 0.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +4 -4
- data/README.md +91 -4
- data/lib/generators/hot_glue/field_factory.rb +2 -1
- data/lib/generators/hot_glue/fields/association_field.rb +1 -1
- data/lib/generators/hot_glue/fields/attachment_field.rb +1 -1
- data/lib/generators/hot_glue/fields/boolean_field.rb +15 -6
- data/lib/generators/hot_glue/fields/date_time_field.rb +19 -3
- data/lib/generators/hot_glue/fields/field.rb +61 -17
- data/lib/generators/hot_glue/fields/float_field.rb +6 -4
- data/lib/generators/hot_glue/fields/uuid_field.rb +1 -1
- data/lib/generators/hot_glue/layout/builder.rb +4 -2
- data/lib/generators/hot_glue/nav_template_generator.rb +22 -0
- data/lib/generators/hot_glue/scaffold_generator.rb +160 -148
- data/lib/generators/hot_glue/templates/controller.rb.erb +2 -2
- data/lib/generators/hot_glue/templates/erb/_edit.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_nav.html.erb +3 -0
- data/lib/generators/hot_glue/templates/system_spec.rb.erb +1 -1
- data/lib/hotglue/version.rb +1 -1
- metadata +4 -2
@@ -125,11 +125,11 @@ class <%= controller_class_name %> < <%= controller_descends_from %>
|
|
125
125
|
}.join("/n") %><% end %><%= controller_attachment_orig_filename_pickup_syntax %>
|
126
126
|
if @<%= singular_name %>.update(modified_params)
|
127
127
|
<% if @display_list_after_update %> load_all_<%= plural %><% end %>
|
128
|
-
flash[:notice] =
|
128
|
+
flash[:notice] = "#{flash[:notice]} Saved \#{@<%= singular %>.<%= display_class %>}"
|
129
129
|
flash[:alert] = @hawk_alarm if @hawk_alarm
|
130
130
|
render :update
|
131
131
|
else
|
132
|
-
flash[:alert] =
|
132
|
+
flash[:alert] = "#{flash[:notice]} <%= singular_name.titlecase %> could not be saved. #{@hawk_alarm}"
|
133
133
|
render :update, status: :unprocessable_entity
|
134
134
|
end
|
135
135
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<h2>Editing <\%= @<%= @singular %>.<%= display_class %> %></h2>
|
8
8
|
<\%= form_with model: <%= "@" + singular %>, url: <%= form_path_edit_helper %> do |f| %>
|
9
|
-
<\%= render partial: "form", locals: {:<%= singular %> => <%= "@" + singular%>, f: f}<%= @nested_set.collect{|arg| ".merge(@#{arg[:singular]} ? {#{arg[:singular]}: @#{arg[:singular]}} : {})" }.join %> \%>
|
9
|
+
<\%= render partial: "<%= namespace_with_trailing_dash + @controller_build_folder + "/" %>form", locals: {:<%= singular %> => <%= "@" + singular%>, f: f}<%= @nested_set.collect{|arg| ".merge(@#{arg[:singular]} ? {#{arg[:singular]}: @#{arg[:singular]}} : {})" }.join %> \%>
|
10
10
|
<\% end %>
|
11
11
|
</div>
|
12
12
|
<\% end %>
|
@@ -91,7 +91,7 @@ describe 'interaction for <%= controller_class_name %>' do
|
|
91
91
|
it "should destroy" do
|
92
92
|
visit <%= path_helper_plural %>
|
93
93
|
accept_alert do
|
94
|
-
find("form[action='<%= namespace_with_dash %>/<%= plural %>/#{<%= singular %>1.id}'] > input.delete-<%= singular %>-button").click
|
94
|
+
find("form[action='<%= namespace_with_dash %>/<%= nested_path %><%= plural %>/#{<%= singular %>1.id}'] > input.delete-<%= singular %>-button").click
|
95
95
|
end
|
96
96
|
expect(page).to_not have_content(<%= singular %>1.<%= @display_class %>)
|
97
97
|
expect(<%= singular_class %>.where(id: <%= singular %>1.id).count).to eq(0)
|
data/lib/hotglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot-glue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- lib/generators/hot_glue/layout_strategy/tailwind.rb
|
105
105
|
- lib/generators/hot_glue/markup_templates/base.rb
|
106
106
|
- lib/generators/hot_glue/markup_templates/erb.rb
|
107
|
+
- lib/generators/hot_glue/nav_template_generator.rb
|
107
108
|
- lib/generators/hot_glue/scaffold_generator.rb
|
108
109
|
- lib/generators/hot_glue/templates/base_controller.rb.erb
|
109
110
|
- lib/generators/hot_glue/templates/capybara_login.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- lib/generators/hot_glue/templates/erb/_form.erb
|
115
116
|
- lib/generators/hot_glue/templates/erb/_line.erb
|
116
117
|
- lib/generators/hot_glue/templates/erb/_list.erb
|
118
|
+
- lib/generators/hot_glue/templates/erb/_nav.html.erb
|
117
119
|
- lib/generators/hot_glue/templates/erb/_new_button.erb
|
118
120
|
- lib/generators/hot_glue/templates/erb/_new_form.erb
|
119
121
|
- lib/generators/hot_glue/templates/erb/_show.erb
|