Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update
- respond_to do |format|
- if @article.update(article_params)
- format.html do
- redirect_to article_path,
- notice: 'Article has been updated'
- end
- else
- format.html do
- render :edit,
- notice: "Article couldn't be updated. Please try again" //this is what should be send to the view
- end
- end
- end
- <% flash.each do |key, value| %>
- <div class="alert alert-<%= key %>">
- <a href="#" data-dismiss="alert" class="close">×</a>
- <ul>
- <li>
- <%= value %>
- </li>
- </ul>
- </div>
- <% end %>
- #<ActionDispatch::Flash::FlashHash:0x00007fa5c05fcd60 @discard=#<Set: {}>, @flashes={}, @now=nil>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement