ensl.org/app/views/maps/_form.html.erb
2020-04-07 00:33:09 +03:00

28 lines
853 B
Text

<%= form_for @map, html: { multipart: true, class: 'square' } do |f| %>
<%= render 'shared/errors', messages: @map.errors.full_messages %>
<div class="fields horizontal">
<%= f.label :name %>
<%= f.text_field :name %>
</div>
<div class="fields horizontal">
<%= f.label :category_id %>
<%= f.select :category_id, Category.ordered.domain(Category::DOMAIN_GAMES).collect { |c| [c, c.id] } %>
</div>
<div class="fields horizontal">
<%= f.label :download %>
<%= f.text_field :download %>
</div>
<div class="fields horizontal">
<%= f.label :picture %>
<div class="inputs">
<% if @map.picture&.file&.exists? %>
<%= image_tag @map.picture.url %><br>
<% end %>
<%= f.file_field :picture %>
</div>
</div>
<div class="controls">
<%= f.submit 'Update Map' %>
</div>
<% end %>