summaryrefslogtreecommitdiff
path: root/app/views/runs/new.html.erb
blob: 0c5c3adabe4fa1241b0e3968511deae93e6fff6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%= form_with model: @run do |f| %>
  <div>
    <%= f.label :game_id, "Game" %>
    <%= f.collection_select :game_id, Game.all, :id, :title, {prompt: "Choose..."} %>
  </div>

  <div>
    <%= f.label :title %>
    <%= f.text_field :title %>
  </div>

  <div>
    <%= f.label :description %>
    <%= f.text_area :description %>
  </div>

  <div>
    <%= f.submit "Start run", class: "btn-primary" %>
  </div>

  <% if @run.errors.any? %>
    <div>
      <p><%= pluralize(@run.errors.count, "error") %> prohibited this run from being saved:</p>
      <ul>
        <% @run.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
<% end %>