Open
Conversation
…all content added
Media RankerWhat We're Looking For
|
|
You killed it with this project! Good job catching some of the edge cases, like trying to log in with an empty string username. (Not a lot of people caught this :) ) The look of the site looks so spot on, too! Great job. You found a way to display error messages anyway, but we expected those to be passed into flash messages (which you also set!) |
tildeee
reviewed
Oct 17, 2017
| flash[:success] = "Item successfully added" | ||
| redirect_to root_path | ||
| else | ||
| flash.now[:success] = "Item could not be added" |
There was a problem hiding this comment.
maybe instead of adding this message to [:success], you could do a line something like this in the controller
flash[:error] = @work.errors.messages
and in your view (probably application.html.erb) the following code:
<% work.errors.messages.each do |name, errors| %>
<% errors.each do |message| %>
error name: <% name %>
error message: <% message %>
<% end %>
<% end %>
Of course this is just some inspiration code, you can form it to what you need it to be :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?