Move geozone form partial to a component

That way it'll be easier to refactor it.
This commit is contained in:
Javi Martín
2023-04-26 17:09:04 +02:00
parent 1462ae72a8
commit c6c09074df
4 changed files with 11 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
<%= form_for [:admin, geozone] do |f| %>
<%= render "shared/errors", resource: geozone %>
<div class="small-12 large-8 column">
<%= f.text_field :name %>
</div>
<div class="clear">
<div class="small-12 medium-6 large-4 column">
<%= f.text_field :census_code, hint: t("admin.geozones.geozone.code_help") %>
</div>
<div class="small-12 medium-6 large-4 column end">
<%= f.text_field :external_code, hint: t("admin.geozones.geozone.code_help") %>
</div>
</div>
<div class="small-12 large-8 column">
<%= f.text_field :html_map_coordinates, hint: t("admin.geozones.geozone.coordinates_help") %>
</div>
<div class="small-12 column">
<%= f.submit(value: t("admin.geozones.edit.form.submit_button"),
class: "button success") %>
</div>
<% end %>

View File

@@ -0,0 +1,7 @@
class Admin::Geozones::FormComponent < ApplicationComponent
attr_reader :geozone
def initialize(geozone)
@geozone = geozone
end
end