Skip to content

Commit

Permalink
Refactor: use form_with for Event form
Browse files Browse the repository at this point in the history
Apparently form_for is soft-deprecated? Not sure why. form_with feels
more flexible in any case.
  • Loading branch information
dgmstuart committed Apr 16, 2023
1 parent 9314afb commit 0d9c730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions app/assets/stylesheets/cms/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ div.actions {
}
}

form.new_event,
form.edit_event,
form.event-form,
form.new_organiser,
form.edit_organiser,
form.new_venue,
Expand Down Expand Up @@ -108,6 +107,12 @@ form.edit_venue {
margin: 3px 0 5px;
}

.form-section-title label {
font-size: inherit;
font-family: inherit;
font-weight: inherit;
}

.form-group {
margin-bottom: 15px;
}
Expand Down Expand Up @@ -168,12 +173,6 @@ form.edit_venue {
}
}

form.edit_event h3 label {
font-size: inherit;
font-family: inherit;
font-weight: inherit;
}

// Rails Errors
/////////////////////////////////////////////
#error-explanation {
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_for(@event) do |f| %>
<%= form_with(model: @event, class: "event-form") do |f| %>
<%= render "shared/error_messages", target: @event %>

<section>
Expand Down

0 comments on commit 0d9c730

Please sign in to comment.