Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instruction You will be developing a TicketMaster-like application, used to view and purchase tickets to upcoming shows. The idea is that customers can log into

Instruction

You will be developing a TicketMaster-like application, used to view and purchase tickets to upcoming shows. The idea is that customers can log into the site to purchase tickets. Administrative users will be able to create and edit concert information and see a list of purchases that have been made.

Using Rails built-in scaffolding, create the models as described on the model diagram.

image text in transcribed

Create a Register link in your navigation area. This link should allow an individual to register on the website. Ensure you have set up the User model as described to support the authlogic functionality.

Ensure that registered users can log in and log out of your web application.

Logged-in users should have the ability to update their profiles (username, email, and password.)

Update the navigation of your layout to meet the following criteria: Logged-out users should see two links: Register and Login, Logged-in users should see two links: "Edit Profile" and Logout

Install and require the cancancan gem in your application.

Using Rails built-in scaffolding, create the files for the Role class, as described on the model diagram attached to this Assignment.

Seed two new roles: Customer and Admin

Create the HABTM association between the User and Role models, and ensure you create a join table in your database to store the relationships.

Use the check_box_tag form helper to allow the selection of roles on the Create or Edit User form pages.

IF A USER IS BEING CREATED: his/her default role should be Customer only and the check_box_tag area should be hidden

IF A CUSTOMER IS LOGGED-IN: s/he should not see the check_box_tag area; Customers should not be able to assign their own roles

IF AN ADMIN IS LOGGED-IN: s/he MAY update the roles of the user being edited. The Admin should be able to select Customer or Admin OR both.

Using Rails built-in scaffolding, create the files for the Concert and "Venue" class, as described on the model diagram attached to this Assignment.

You will need to create a foreign key to support this relationship.

Seed 3 Concerts and 2 Venues in your database. Assign each Concert to a Venue.

Question Create abilities for the Concert model according to the following logic: Customers can index and view (show) all Concert objects, Admins can manage (index, show, create, update, destroy) all Concert objects

Concert has many purchases id: integer "name:String *start date: datetime 'end date: datetime "price: decimal "tickets available:integer created at: datetime updated at: datetime Purchase belongs to concert belongs to user id:integer ticket quantity integer 0. payment amount decimal created at: datetime updated at: datetime Remember your foreign key fields in this table! User has many purchases id:integer username: string 1 email string crypted password string password salt string persistence token:string created at: datetime updated at: datetime User Session username: String password string Watch the video for hints about how to scaffold the User model

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

How do you see the company changing over the next 5 years?

Answered: 1 week ago

Question

What different skills and behaviours will be needed?

Answered: 1 week ago