Browse Source

Make GOVUKDesignSystemFormBuilder the default form builder

pull/118/head
Paul Robert Lloyd 3 years ago
parent
commit
b07de94859
  1. 2
      app/controllers/application_controller.rb
  2. 2
      app/views/case_logs/bulk_upload.html.erb
  3. 2
      app/views/form/check_answers.html.erb
  4. 2
      app/views/form/page.html.erb

2
app/controllers/application_controller.rb

@ -1,4 +1,6 @@
class ApplicationController < ActionController::Base
default_form_builder GOVUKDesignSystemFormBuilder::FormBuilder
def render_not_found_html
render file: Rails.root.join("public/404.html"), status: :not_found
end

2
app/views/case_logs/bulk_upload.html.erb

@ -1,5 +1,5 @@
<div class="govuk-form-group">
<%= form_for @bulk_upload, url: bulk_upload_case_logs_path, method: "post", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= form_for @bulk_upload, url: bulk_upload_case_logs_path, method: "post" do |f| %>
<%= f.govuk_error_summary %>
<%= f.govuk_file_field :case_log_bulk_upload,
label: { text: "Bulk Upload", size: "l" },

2
app/views/form/check_answers.html.erb

@ -8,7 +8,7 @@
<%= render partial: 'form/check_answers_table', locals: { question: question, case_log: @case_log } %>
<% end %>
</dl>
<%= form_with model: @case_log, method: "get", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= form_with model: @case_log, method: "get" do |f| %>
<%= f.govuk_submit "Save and continue" %>
<% end %>
</div>

2
app/views/form/page.html.erb

@ -16,7 +16,7 @@
<%= page.header %>
</h1>
<% end %>
<%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %>
<%= f.govuk_error_summary %>
<% page.questions.map do |question| %>
<div id=<%= question.id + "_div " %><%= display_question_key_div(page, question) %> >

Loading…
Cancel
Save