summaryrefslogtreecommitdiff
path: root/app/views/runs/new.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/runs/new.html.erb')
-rw-r--r--app/views/runs/new.html.erb31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/views/runs/new.html.erb b/app/views/runs/new.html.erb
new file mode 100644
index 0000000..e8b7b6e
--- /dev/null
+++ b/app/views/runs/new.html.erb
@@ -0,0 +1,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" %>
+ </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 %>