Open
Conversation
elie
reviewed
Dec 4, 2017
| return redirect(url_for('messages_index', user_id=user_id)) | ||
| return render_template('messages/index.html', user=User.query.get(user_id)) | ||
|
|
||
| @app.route('/users/<int:user_id>/messages/new', methods=["GET", "POST"]) |
Contributor
There was a problem hiding this comment.
This one doesn't need to have a methods=["GET", "POST"] - that was a mistake in the screencast :) - we just need "GET" here
elie
requested changes
Dec 4, 2017
Contributor
elie
left a comment
There was a problem hiding this comment.
Good start, but you have to use the forms you create on the server in your HTML templates - please see my comments and fix this up
| def messages_new(user_id): | ||
| return render_template('messages/new.html', user=User.query.get(user_id)) | ||
|
|
||
| @app.route('/users/<int:user_id>/messages/<int:id>/edit', methods=["GET", "POST"]) |
| {% block content %} | ||
| <h1>Edit a new message</h1> | ||
| <form method="POST" action="{{url_for('messages_show', user_id=message.user.id, id=message.id)}}?_method=PATCH"> | ||
| <input type="text" name="content" value={{message.content}}> |
Contributor
There was a problem hiding this comment.
Where is your WTForm? You should not be using input tags here
|
|
||
| <h1>Add a new user!</h1> | ||
| <form method="POST" action="{{url_for('show', id=user.id)}}?_method=PATCH" > | ||
| <input type="text" name="first_name" value="{{user.first_name}}"> |
Contributor
There was a problem hiding this comment.
Where is your WTForm? You should not be using input tags here
| {% block content %} | ||
| <h1>Add a new message</h1> | ||
| <form method="POST" action="{{url_for('messages_index', user_id=user.id)}}"> | ||
| <input type="text" name="content"> |
Contributor
There was a problem hiding this comment.
Where is your WTForm? You should not be using input tags here
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.
No description provided.