Browse Source

added template for new

pull/704/head
JG 3 years ago
parent
commit
5074b92d58
  1. 22
      app/views/locations/new.html.erb
  2. 1
      config/routes.rb

22
app/views/locations/new.html.erb

@ -0,0 +1,22 @@
<% content_for :title, "Add a location to this scheme" %>
<% content_for :before_content do %>
<%= govuk_back_link(
text: "Back",
href: "javascript:history.go(-1);",
) %>
<% end %>
<%= form_for(@location, method: :post, url: location_create_scheme_path) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %>
<h1 class="govuk-heading-l">
<%= content_for(:title) %>
</h1>
<%= f.govuk_submit "Save and continue" %>
</div>
</div>
<% end %>

1
config/routes.rb

@ -46,6 +46,7 @@ Rails.application.routes.draw do
member do
get "locations", to: "schemes#locations"
get "location/new", to: "locations#new"
post "location/create", to: "locations#create"
end
end

Loading…
Cancel
Save