Skip to content

Commit

Permalink
Add alert for application creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Laddusaw committed Aug 15, 2024
1 parent d8d79ed commit 2f69077
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/locker_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def update_or_create(valid, message: 'Locker application was successfully update
respond_to do |format|
if valid
if method == :new && Flipflop.lewis_patrons?
format.html { redirect_to edit_locker_application_url(@locker_application) }
format.html do
redirect_to edit_locker_application_url(@locker_application), notice: { message: 'Application successfully created', type: 'success' }
end
else
format.html { redirect_to @locker_application, notice: { message:, type: 'success' } }
end
Expand Down
3 changes: 3 additions & 0 deletions app/views/locker_applications/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% content_for :title do %>
Edit application
<% end %>
<% if notice.present? %>
<alert status="<%= notice['type'] %>" dismissible><%= notice['message'] %></alert>
<% end %>
<%= render 'form', locker_application: @locker_application %>

<%= link_to 'Show', @locker_application %> |
Expand Down

0 comments on commit 2f69077

Please sign in to comment.