Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

187460419 support delete event #377

Merged
merged 7 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/controllers/admin/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ def toggle_attendance
end
end

def destroy
@event = Event.find(params[:id])
if @event.destroy
flash[:notice] = 'Event successfully deleted.'
redirect_to admin_conference_program_events_path(@conference.short_title)
else
flash[:alert] = 'Event could not be deleted.'
redirect_to admin_conference_program_event_path(@conference.short_title, @event)
end
end

private

def event_params
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/events/_proposal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
= link_to 'Preview', conference_program_proposal_path(@conference.short_title, @event.id), class: 'btn btn-mini btn-primary'
= link_to 'Registrations', registrations_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-success'
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
= link_to 'Delete', admin_conference_program_event_path(@conference.short_title, @event), method: :delete, data: { confirm: 'Are you sure you want to delete this event?' }, class: 'btn btn-mini btn-danger'


.row
.col-md-12
Expand Down
Loading