Skip to content
Snippets Groups Projects
Commit b8825ebf authored by Dore, Kieran D (UG - Comp Sci & Elec Eng)'s avatar Dore, Kieran D (UG - Comp Sci & Elec Eng)
Browse files

Cleaned out views

parent ff85319a
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 204 deletions
= form_for @list do |f|
- if @list.errors.any?
#error_explanation
%h2= "#{pluralize(@list.errors.count, "error")} prohibited this list from being saved:"
%ul
- @list.errors.full_messages.each do |message|
%li= message
.field
= f.label :name
= f.text_field :name
.field
= f.label :user
= f.text_field :user
.actions
= f.submit 'Save'
json.extract! list, :id, :name, :user_id, :created_at, :updated_at
json.url list_url(list, format: :json)
%h1 Editing list
= render 'form'
= link_to 'Show', @list
\|
= link_to 'Back', lists_path
%h1 Listing lists
%table
%thead
%tr
%th Name
%th User
%th
%th
%th
%tbody
- @lists.each do |list|
%tr
%td= list.name
%td= list.user
%td= link_to 'Show', list
%td= link_to 'Edit', edit_list_path(list)
%td= link_to 'Destroy', list, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to 'New List', new_list_path
json.array! @lists, partial: "lists/list", as: :list
%h1 New list
= render 'form'
= link_to 'Back', lists_path
%p#notice= notice
%p
%b Name:
= @list.name
%p
%b User:
= @list.user
= link_to 'Edit', edit_list_path(@list)
= link_to 'Back', lists_path
json.partial! "lists/list", list: @list
= form_for @product do |f|
- if @product.errors.any?
#error_explanation
%h2= "#{pluralize(@product.errors.count, "error")} prohibited this product from being saved:"
%ul
- @product.errors.full_messages.each do |message|
%li= message
.field
= f.label :name
= f.text_field :name
.field
= f.label :quantity
= f.number_field :quantity
.field
= f.label :acquired
= f.check_box :acquired
.field
= f.label :list
= f.number_field :list
.actions
= f.submit 'Save'
json.extract! product, :id, :name, :quantity, :price, :acquired, :list, :created_at, :updated_at
json.url product_url(product, format: :json)
%h1 Editing product
= render 'form'
= link_to 'Show', @product
\|
= link_to 'Back', products_path
%h1 Listing products
%table
%thead
%tr
%th Name
%th Quantity
%th Price
%th Accuired
%th List
%th
%th
%th
%tbody
- @products.each do |product|
%tr
%td= product.name
%td= product.quantity
%td= product.acquired
%td= product.list
%td= link_to 'Show', product
%td= link_to 'Edit', edit_product_path(product)
%td= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to 'New Product', new_product_path
json.array! @products, partial: "products/product", as: :product
%h1 New product
= render 'form'
= link_to 'Back', products_path
%p#notice= notice
%p
%b Name:
= @product.name
%p
%b Quantity:
= @product.quantity
%p
%b Accuired:
= @product.acquired
%p
%b List:
= @product.list
= link_to 'Edit', edit_product_path(@product)
\|
= link_to 'Back', products_path
json.partial! "products/product", product: @product
= form_for @user do |f|
- if @user.errors.any?
#error_explanation
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
%ul
- @user.errors.full_messages.each do |message|
%li= message
.field
= f.label :name
= f.text_field :name
.field
= f.label :email
= f.text_field :email
.field
= f.label :password
= f.text_field :password
.actions
= f.submit 'Save'
json.extract! user, :id, :name, :email, :password, :created_at, :updated_at
json.url user_url(user, format: :json)
%h1 Editing user
= render 'form'
= link_to 'Show', @user
\|
= link_to 'Back', users_path
%h1 Listing users
%table
%thead
%tr
%th Name
%th Email
%th Password
%th
%th
%th
%tbody
- @users.each do |user|
%tr
%td= user.name
%td= user.email
%td= user.password
%td= link_to 'Show', user
%td= link_to 'Edit', edit_user_path(user)
%td= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to 'New User', new_user_path
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment