In completing this assignment you MAY use/access the following resources:
You may NOT use/access:
- Resources not expressly listed above, including, but not limited to,
the following ...
- Source code not provided as part of this assignment. (Obviously, this
includes, but is not limited to, source code written by other students
whether current or in the past).
- Code-generating tools (of which ChatGPT is one example).
- Any web sites not directly linked to from the homework assignment.
Failure to abide by these guidelines will result in a zero for the assignment
and the incident will be reported to the university provost as a violation of
the university academic integrity policy. A second incident of academic
dishonesty (whether from this course or another computer science course) will
result in an F in the course.
You should complete each of these steps:
- Establish a model that maps to your books table.
- Modify the index route/view to pull book info and display it to the screen
as you did in in HW #5.
- Implement the addbook form to trim, do validation, repopulate when validation
fails, and safely save valid, entered values to the database. Your code should
mitigate both CSRF and SQL injection attacks. The form should redirect to the
home page after a success entry.
- Implement the bookdetail route/view to display a book's detailed information
when the book title is clicked on the home page. This view should also provide
buttons to modify and delete the book. If a book id is not provided as a query
string parameter to the bookdetail page (or is invalid) then redirect to the error
page with the
book_not_found
code.
By the end of this assignment the book application should be completely functional with
the exception of user logins, sessions, and permissions. This includes:
- Styling should be done in an external CSS document.
- Each page has a Menu with Home, Add Book, and Login with working links
(except for Login)
- The home page should display title and price of books with the title being
a clickable link to the detail page
- The add book form should validate with the same rules as required in previous
assignment and should safely save valid, entered data to the database. It should
redirect to the home page upon successful entry.
- The bookdetail page should display all available book information and should
provide working Change and Delete buttons. The change button should populate the
form and allow modification of the data. The delete button should remove the specified
book from the database.