Skip to content

Commit

Permalink
Merge pull request #37 from toronto-ruby/crespire/fix-no-method-error
Browse files Browse the repository at this point in the history
Fix no method error
  • Loading branch information
crespire authored Jul 18, 2024
2 parents 9b9177f + 45478f4 commit 23da45f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/admin/events/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<%= form.label :sponsor_logo %>
<%= form.text_field :sponsor_logo %>
<%= form.label :start_at %>
<%= form.datetime_field :start_at, value: event.start_at.in_time_zone("Eastern Time (US & Canada)") %>
<%= form.datetime_field :start_at, value: event&.start_at&.in_time_zone("Eastern Time (US & Canada)").presence || Time.zone.now.in_time_zone("Eastern Time (US & Canada)") %>
<%= form.label :status %>
<%= form.select :status, options_for_select(Event.statuses_for_select, event.status) %>
<%= form.submit %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/events/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<h2>Event List</h2>
<%= link_to "New Event", new_admin_event_path %>
<div class="flow-root">
<ul role="list" class="-mb-8">
<% @events.each do |event| %>
Expand Down

0 comments on commit 23da45f

Please sign in to comment.