Skip to content

Commit

Permalink
Add basic notices (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
thestrabusiness authored and Anthony M committed Dec 8, 2020
1 parent 42953e5 commit 56b051f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def edit

def update
if current_user.update(user_params)
flash[:notice] = "Profile updated"
redirect_to user_path
else
render :edit
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
</div>
<% end %>
<div class="main-content">
<% if flash[:notice] %>
<div class="notice"><%= flash[:notice] %></div>
<% end %>
<%= yield %>
</div>
</body>
Expand Down

0 comments on commit 56b051f

Please sign in to comment.