fix edit
This commit is contained in:
parent
35cb0e2ce8
commit
3b82be0b7d
3 changed files with 20 additions and 19 deletions
18
app/views/server_templates/_form.html.slim
Normal file
18
app/views/server_templates/_form.html.slim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
.server_template_form
|
||||
h2 = @server_template.persisted? ? "Edit Template" : "New Template"
|
||||
|
||||
= form_with model: @server_template, local: true do |f|
|
||||
- if @server_template.errors.any?
|
||||
.alert.alert--error
|
||||
h4 = pluralize(@server_template.errors.count, "error")
|
||||
ul
|
||||
- @server_template.errors.full_messages.each do |msg|
|
||||
li = msg
|
||||
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
|
||||
.form-actions
|
||||
= f.submit class: "btn btn--primary"
|
||||
= link_to "Back", server_templates_path, class: "btn"
|
||||
|
|
@ -1 +1 @@
|
|||
= render "new"
|
||||
= render "form"
|
||||
|
|
|
|||
|
|
@ -1,18 +1 @@
|
|||
.server_template_form
|
||||
h2 = @server_template.persisted? ? "Edit Template" : "New Template"
|
||||
|
||||
= form_with model: @server_template, local: true do |f|
|
||||
- if @server_template.errors.any?
|
||||
.alert.alert--error
|
||||
h4 = pluralize(@server_template.errors.count, "error")
|
||||
ul
|
||||
- @server_template.errors.full_messages.each do |msg|
|
||||
li = msg
|
||||
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
|
||||
.form-actions
|
||||
= f.submit class: "btn btn--primary"
|
||||
= link_to "Back", server_templates_path, class: "btn"
|
||||
= render "form"
|
||||
|
|
|
|||
Loading…
Reference in a new issue