Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. def update
  2. respond_to do |format|
  3. if @article.update(article_params)
  4. format.html do
  5. redirect_to article_path,
  6. notice: 'Article has been updated'
  7. end
  8. else
  9. format.html do
  10. render :edit,
  11. notice: "Article couldn't be updated. Please try again" //this is what should be send to the view
  12. end
  13. end
  14. end
  15.  
  16. <% flash.each do |key, value| %>
  17. <div class="alert alert-<%= key %>">
  18. <a href="#" data-dismiss="alert" class="close">×</a>
  19. <ul>
  20. <li>
  21. <%= value %>
  22. </li>
  23. </ul>
  24. </div>
  25. <% end %>
  26.  
  27. #<ActionDispatch::Flash::FlashHash:0x00007fa5c05fcd60 @discard=#<Set: {}>, @flashes={}, @now=nil>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement