summaryrefslogtreecommitdiff
path: root/app/views/pokedex_entries/new.html.erb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2023-11-03 01:03:48 -0400
committerDavid Gay <david@davidgay.org>2023-11-03 01:03:48 -0400
commit0c5cccbecfc8b71fb318c275f142306e19bb7e43 (patch)
tree178b401fe2ecf6bd965524e078e9882305342a69 /app/views/pokedex_entries/new.html.erb
parent47ecf3f515ef5bd7db2c4f3bce0a872a46ca2233 (diff)
Pokedex entry recording and viewing on runs#show
Diffstat (limited to 'app/views/pokedex_entries/new.html.erb')
-rw-r--r--app/views/pokedex_entries/new.html.erb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/views/pokedex_entries/new.html.erb b/app/views/pokedex_entries/new.html.erb
new file mode 100644
index 0000000..03bcbc8
--- /dev/null
+++ b/app/views/pokedex_entries/new.html.erb
@@ -0,0 +1,25 @@
+<%= turbo_frame_tag "pokedex_entries" do %>
+ <%= form_with model: [@run, @pokedex_entry], class: "space-y-4" do |form| %>
+ <div>
+ <%= form.label :pokemon_id %>
+ <%= form.collection_select :pokemon_id, Pokemon.order(:pokedex_num), :id,
+ ->(pokemon) { "#{pokemon.pokedex_num} - #{pokemon.name}" }, prompt: "Choose...",
+ required: true %>
+ </div>
+
+ <div>
+ <%= form.label :recorded_at %>
+ <%= form.datetime_local_field :recorded_at, value: Time.zone.now, required: true %>
+ </div>
+
+ <div>
+ <%= form.label :shiny %>
+ <%= form.check_box :shiny %>
+ </div>
+
+ <div class="space-x-2">
+ <%= form.submit "Got 'em!", class: "btn btn-primary" %>
+ <%= link_to "Cancel", run_pokedex_entries_path %>
+ </div>
+ <% end %>
+<% end %>