- ERD Development
- ERB view templates
- Rails Models
- Rails Controllers
- Migrations
- Authentication
You will be building a Ruby on Rails application that will be the first, stable version of the Bangazon Platform product site.
- Products will be created by customers, so make sure that you have a column on the
Product
model to store which customer created it. - Add a new model named
ProductType
. Add a foreign key toProductType
in theProduct
model. It must be non-nullable, which means that you will likely need to provide a default value for your migration to work. The only fields needed are the primary key, andLabel
. - Add a model named
PaymentType
. - A
Customer
can have many payment types. - The
Order
model must have a foreign key field to thePaymentType
model, but it can be nullable. However, before an order can be completed, there must be a value for thePaymentType
field.
Make sure you produce a layout with your application.html.erb
in your views/layouts
directory for the application so that the structure of each page is consistent.
- User registration and login.
- Product creation form for user to sell a product.
- List of all product types.
- Provide a view to show all products that are of a particular product type.
- List all products, with the name text as a hyperlink to the detail view.
- Provide a product detail view.
- List payment types for current customer.
- On the product detail view, have an
Add to Order
button that, when clicked, either creates a new order for a customer that doesn't have an active one, or adds to an existing open order. - In the navigation bar, have an affordance that shows the current customer how many items are in their order.
- If the user clicks on their order in the navigation bar, take them to the order detail view, which lists products, their prices, and current total for order.
- On the order detail view, have a button labeled
Complete Order
. - When a customer starts to complete an order, show them a list of payment types that are assigned to them. When they select one to add to the order, then the order is complete.
Using the requirements above create a model for each resource, and use migrations to ensure your database structure is up to date.
Validations in your model Active Record Associations Active Record Querying
Rails, like Angular, has many built-in helper tags and filters when building the site templates. We strongly recommend reading this documentation while building your templates.