Skip to content

Commit

Permalink
Merge pull request #456 from commercekitchen/require_program_location…
Browse files Browse the repository at this point in the history
…_name

Require program location name
  • Loading branch information
tmichaelreis authored Jun 12, 2020
2 parents 7aa4c28 + 568bee1 commit d8d4e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/views/admin/program_locations/create.js.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$("#program_location_rows").append("<%= escape_javascript(render(partial: 'location_row', locals: { program_location: @program_location })) %>");
$("#program_location_location_name").val('');
<% if @program_location.valid? %>
$("#program_location_rows").append("<%= escape_javascript(render(partial: 'location_row', locals: { program_location: @program_location })) %>");
$("#program_location_location_name").val('');
<% end %>
2 changes: 1 addition & 1 deletion app/views/admin/programs/_program_locations_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class='form-row'>
<fieldset>
<div class='inline-form'>
<%= f.text_field :location_name %>
<%= f.text_field :location_name, required: true %>
<%= f.submit "Add", id: "addLocation" %>
<%= f.hidden_field :program_id, :value => @program.id %>
</div>
Expand Down

0 comments on commit d8d4e50

Please sign in to comment.