Commit 34538002 authored by Chanelle Lunod's avatar Chanelle Lunod

initial commit

parents 7eb1cfec d1dbca7c
...@@ -5,4 +5,6 @@ ...@@ -5,4 +5,6 @@
@import "bootstrap"; @import "bootstrap";
#container { padding-top: 5rem; } #container { padding-top: 5rem; }
body {background-color: #d9e6f2;} body {
background-color: #000000;
}
...@@ -6,21 +6,21 @@ class OrdersController < ApplicationController ...@@ -6,21 +6,21 @@ class OrdersController < ApplicationController
def new def new
@product = Product.find_by(id: params[:product_id]) @product = Product.find_by(id: params[:product_id])
@order = @order.transactions.new @order = @product.transactions.new
end end
def create def create
@product = Product.find_by(id: params[:product_id]) @product = Product.find_by(id: params[:product_id])
@order = @order.transactions.new(supply_params) @order = @product.transactions.new(order_params)
@order.mode = "Order" @order.mode = "Order"
@order.user_id = current_user.id @order.user_id = current_user.id
@order.quantity = @order.quantity * -1 @order.quantity = @order.quantity
if @product.save if @product.save
redirect_to authenticated_user_root_path, notice: "You have successfully placed a new order" redirect_to authenticated_user_root_path, notice: "You have successfully placed a new order"
else else
render 'new' render 'new'
end end
end end
private private
......
class ProductsController < ApplicationController class ProductsController < ApplicationController
before_action :authenticate_admin_user!
def index def index
@products = Product.all @products = Product.all
@products = Product.where(["name LIKE ?","%#{params[:search]}%"]) @products = Product.where(["name LIKE ?","%#{params[:search]}%"])
......
class SuppliesController < ApplicationController class SuppliesController < ApplicationController
def index def index
@products = Product.all @products = Product.all
end end
def new def new
@product = Product.find_by(id: params[:product_id]) @product = Product.find_by(id: params[:product_id])
@supply = @product.transactions.new @supply = @product.transactions.new
end end
def create def create
@product = Product.find_by(id: params[:product_id]) @product = Product.find_by(id: params[:product_id])
@supply = @product.transactions.new(supply_params) @supply = @product.transactions.new(supply_params)
@supply.mode = "Supply" @supply.mode = "Supply"
@supply.user_id = current_user.id @supply.user_id = current_user.id
@supply.quantity =@supply.quantity @supply.quantity = @supply.quantity
if @product.save if @product.save
redirect_to authenticated_user_root_path, notice: "You have successfully added a new supply." redirect_to authenticated_user_root_path, notice: "You have successfully added a new supply."
else else
render 'new' render 'new'
end end
end end
private private
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>PRODUCTS</title> <title>PRODUCTS</title>
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= csp_meta_tag %> <%= csp_meta_tag %>
...@@ -13,27 +16,63 @@ ...@@ -13,27 +16,63 @@
<body> <body>
<style> <style>
body,h2,h3,h4,h5,h6 {font-family: "Montserrat", sans-serif}
h1 {font-family: "Clibri", sans-serif}
.w3-row-padding img {margin-bottom: 12px}
.w3-sidebar {width: 120px;background: #222;}
#main {margin-left: 120px}
@media only screen and (max-width: 600px) {#main {margin-left: 0}}
</style>
<!-- <style>
background-color: #ccfff2 background-color: #ccfff2
font-family:'Calibri'; font-family:'Calibri';
</style> </style> -->
<nav class="navbar navbar-expand-xl navbar-dark bg-dark"> <body class="w3-black">
<%= link_to "HOME", root_path, class: "navbar-brand" %> <nav class="w3-sidebar w3-bar-block w3-small w3-hide-small w3-center">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <!-- Avatar image in top left corner -->
<span class="navbar-toggler-icon"></span> <img src="https://218run.com/wp-content/uploads/2013/10/yonex_logo_wp-300x300.jpg" style="width:100%">
</button> <a href="#" class="w3-bar-item w3-button w3-padding-large w3-black">
<i class="fa fa-home w3-xxlarge"></i>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <p>HOME</p>
<ul class="navbar-nav mr-auto"> </a>
<li class="nav-item"> <a href="#signin" class="w3-bar-item w3-button w3-padding-large w3-hover-black">
<a class="nav-link" href="#">Sign In</a> <i class="fa fa-user w3-xxlarge"></i>
</li> <p>SIGN IN</p>
<li class="nav-item"> </a>
<a class="nav-link" href="#">Inventory</a> <a href="#products" class="w3-bar-item w3-button w3-padding-large w3-hover-black">
</li> <i class="fa fa-eye w3-xxlarge"></i>
<li class="nav-item"> <p>PRODUCTS</p>
<a class="nav-link" href="#">Transactions</a> </a>
</li> <a href="#contact" class="w3-bar-item w3-button w3-padding-large w3-hover-black">
</ul> <i class="fa fa-envelope w3-xxlarge"></i>
<p>CONTACT</p>
</a>
<a href="#search" class="w3-bar-item w3-button w3-padding-large w3-hover-black">
<i class="fa fa-search w3-xxlarge"></i>
<p>SEARCH</p>
</a>
</nav>
<div class="w3-top w3-hide-large w3-hide-medium" id="myNavbar">
<div class="w3-bar w3-black w3-opacity w3-hover-opacity-off w3-center w3-small">
<a href="#" class="w3-bar-item w3-button" style="width:25% !important">HOME</a>
<a href="#signin" class="w3-bar-item w3-button" style="width:25% !important">SIGN IN</a>
<a href="#products" class="w3-bar-item w3-button" style="width:25% !important">PRODUCTS</a>
<a href="#contact" class="w3-bar-item w3-button" style="width:25% !important">CONTACT</a>
<a href="#search" class="w3-bar-item w3-button" style="width:25% !important">SEARCH</a>
</div>
</div>
<div class="w3-padding-large" id="main">
<!-- Header/Home -->
<header class="w3-container w3-padding-32 w3-center w3-black" id="home">
<h1 class="w3-jumbo"><span class="w3-hide-small">YONEX</h1>
<p>"The #1 trusted brand by all athletes accross the globe."</p>
<img src="http://www.sunrisecatalogue.com/uploads/posters/duovsvt_ldlcw_YYSRSRC.jpg" alt="boy" class="w3-image" width="992" height="1108">
</header>
</span>
<div class="w3-content w3-justify w3-text-white w3-padding-64" id="signin">
<span class="navbar-text"> <span class="navbar-text">
<% if user_signed_in? %> <% if user_signed_in? %>
Logged in as <strong><%= current_user.email %></strong>. Logged in as <strong><%= current_user.email %></strong>.
...@@ -44,31 +83,139 @@ ...@@ -44,31 +83,139 @@
<%= link_to "Logout", destroy_admin_user_session_path, method: :delete, :class => 'navbar-link' %> <%= link_to "Logout", destroy_admin_user_session_path, method: :delete, :class => 'navbar-link' %>
<% end %> <% end %>
</span> </span>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search"> <div class="container" id="container">
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button> <% if notice %>
</form> <p class="alert alert-success"><%= notice %></p>
<%= form_tag products_path, :method => 'get' do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search" %>
<% end %> <% end %>
<% if alert %>
<p class="alert alert-danger"><%= alert %></p>
<% end %>
<%= yield %>
</div><br>
<br>
<br>
<h3 class="w3-padding-16 w3-text-light-grey">Our Ratings</h3>
<p class="w3-wide">Badminton</p>
<div class="w3-white">
<div class="w3-dark-grey" style="height:28px;width:99%"></div>
</div> </div>
</nav> <p class="w3-wide">Golf</p>
<div class="w3-white">
<div id="google_translate_element"></div><script type="text/javascript"> <div class="w3-dark-grey" style="height:28px;width:97%"></div>
function googleTranslateElementInit() { </div>
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'af,ar,da,de,en,es,fi,fr,hi,id,is,ja,ko,mi,ms,my,nl,no,pt,sw,tl,zh-CN', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element'); <p class="w3-wide">Tennis</p>
} <div class="w3-white">
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>> <div class="w3-dark-grey" style="height:28px;width:95%"></div>
</div><br>
<div class="container" id="container">
<% if notice %> <div class="w3-row w3-center w3-padding-16 w3-section w3-light-grey">
<p class="alert alert-success"><%= notice %></p> <div class="w3-quarter w3-section">
<% end %> <span class="w3-xlarge">500+</span><br>
<% if alert %> Partners
<p class="alert alert-danger"><%= alert %></p> </div>
<% end %> <div class="w3-quarter w3-section">
<%= yield %> <span class="w3-xlarge">800</span><br>
Stores Worldwide
</div>
<div class="w3-quarter w3-section">
<span class="w3-xlarge">1M++</span><br>
Happy Athletes
</div>
<div class="w3-quarter w3-section">
<span class="w3-xlarge">650+</span><br>
Distributors
</div>
</div>
</div>
<!-- Portfolio Section -->
<div class="w3-padding-64 w3-content" id="products">
<h2 class="w3-text-light-grey">Featured</h2>
<hr style="width:200px" class="w3-opacity">
<!-- Grid for photos -->
<div class="w3-row-padding" style="margin:0 -16px">
<div class="w3-half">
<img src="http://www.sunrisecatalogue.com/uploads/posters/DUORA%20Series%20Ad.jpg" style="width:100%">
<img src="http://www.sunrisecatalogue.com/uploads/posters/Tour%20Racquets%202016.png" style="width:100%">
<img src="http://www.sunrisecatalogue.com/uploads/posters/NR95DX%20and%20NR70DX%20final.jpg" style="width:100%">
</div>
<div class="w3-half">
<img src="http://www.sunrisecatalogue.com/uploads/posters/duovsvt_version_YYSRSRC.jpg" style="width:100%">
<img src="http://www.sunrisecatalogue.com/uploads/posters/VTDG-10-and-7.jpg" style="width:100%">
<img src="http://www.sunrisecatalogue.com/uploads/posters/ARC10%20Poster.jpg" style="width:100%">
</div>
<!-- End photo grid -->
</div>
<!-- End Portfolio Section -->
</div>
<!-- Contact Section -->
<div class="w3-padding-64 w3-content w3-text-grey" id="contact">
<h2 class="w3-text-light-grey">Contact Us</h2>
<hr style="width:200px" class="w3-opacity">
<div class="w3-section">
<p><i class="fa fa-map-marker fa-fw w3-text-white w3-xxlarge w3-margin-right"></i> 3-23-13 Yushima, Bunkyo-ku, Tokyo 113-8543, Japan</p>
<p><i class="fa fa-phone fa-fw w3-text-white w3-xxlarge w3-margin-right"></i> Phone: +00 12345</p>
<p><i class="fa fa-envelope fa-fw w3-text-white w3-xxlarge w3-margin-right"> </i> Email: yonex@obf.ateneo.edu</p>
</div><br>
<p>If you have any questions, send us an email:</p>
<form action="/action_page.php" target="_blank">
<p><input class="w3-input w3-padding-16" type="text" placeholder="Name" required name="Name"></p>
<p><input class="w3-input w3-padding-16" type="text" placeholder="Email" required name="Email"></p>
<p><input class="w3-input w3-padding-16" type="text" placeholder="Subject" required name="Subject"></p>
<p><input class="w3-input w3-padding-16" type="text" placeholder="Message" required name="Message"></p>
<p>
<button class="w3-button w3-light-grey w3-padding-large" type="submit">
<i class="fa fa-paper-plane"></i> SEND EMAIL
</button>
</p>
</form>
</div> </div>
<!-- End Contact Section -->
<div class="w3-padding-64 w3-content w3-text-white">
<h2>Our Founders</h2> <br>
<img src="https://scontent.fmnl4-4.fna.fbcdn.net/v/t31.0-8/26758507_10208855439018286_1377917175667961785_o.jpg?_nc_cat=0&oh=ff30e6770ff054370e1fa725ffe1580d&oe=5BD55DF1" alt="Avatar" class="w3-left w3-circle w3-margin-right" style="width:80px">
<p><span class="w3-large w3-margin-right">Andrea Dolendo -</span> Chief Executive Officer</p><br>
<img src="https://scontent.fmnl4-4.fna.fbcdn.net/v/t31.0-8/26232467_10204296200921706_5390473562677293564_o.jpg?_nc_cat=0&oh=e91a4fb887a4bd2437830cb9bb5999f0&oe=5C126350" alt="Avatar" class="w3-left w3-circle w3-margin-right" style="width:80px">
<p><span class="w3-large w3-margin-right">Chanelle Lunod -</span> Chief Operating Officer</p>
</div>
<!-- End About Section -->
<!-- Footer -->
<footer class="w3-content w3-padding-64 w3-text-grey w3-xlarge">
<i class="fa fa-facebook-official w3-hover-opacity"></i>
<i class="fa fa-instagram w3-hover-opacity"></i>
<i class="fa fa-snapchat w3-hover-opacity"></i>
<i class="fa fa-pinterest-p w3-hover-opacity"></i>
<i class="fa fa-twitter w3-hover-opacity"></i>
<i class="fa fa-linkedin w3-hover-opacity"></i>
<p class="w3-medium">Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank" class="w3-hover-text-green">w3.css</a></p>
<!-- End footer -->
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'af,ar,da,de,en,es,fi,fr,hi,id,is,ja,ko,mi,ms,my,nl,no,pt,sw,tl,zh-CN', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</footer>
</div>
</nav>
<!-- Search Section -->
<div class="w3-padding-64 w3-content w3-text-grey" id="search">
<h2 class="w3-text-light-grey">Search Products</h2>
<%= form_tag products_path, :method => 'get' do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", class: 'btn btn-outline-info my-2 my-sm-0' %>
<% end %>
</div>
</body> </body>
</html> </html>
<h1>New Order</h1> <h1>New Order</h1>
<%= simple_form_for @post do |f| %> <%= simple_form_for([@product, @order], url: product_orders_path) do |f| %>
<%= f.input :quantity, as: :integer %> <%= f.input :quantity %>
<%= f.button :submit, "Add Supply", class: "btn btn-info" %> <%= f.button :submit, "Add Order", class: "btn btn-primary" %>
<%= link_to "Back", transaction_path, class: "btn btn-default" %> <%= link_to "Back", authenticated_user_root_path, class: "btn-btn-default" %>
<% end %> <% end %>
\ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%= simple_form_for @product do |f| %> <%= simple_form_for @product do |f| %>
<%= f.input :name %> <%= f.input :name %>
<%= f.input :description, as: :text %> <%= f.input :description, as: :text %>
<%= f.input :status, as: :radio_buttons, collection: [['Active', 'Active'], ['Inactive', 'Inactive']], value_method: :first, label_method: :second %>
<%= f.button :submit, "Save", class: "btn btn-primary" %> <%= f.button :submit, "Save", class: "btn btn-primary" %>
<%= link_to "Back", products_path, class: "btn btn-default" %> <%= link_to "Back", products_path, class: "btn btn-default" %>
<% end %> <% end %>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</small> </small>
<% else %> <% else %>
<table class = "table", cellspacing="0", cellpadding="0"> <table class = "table", cellspacing="0", cellpadding="0">
<thead style="background-color: #333"> <thead style="background-color: #F08080">
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
<th>Status</th> <th>Status</th>
...@@ -36,12 +36,11 @@ ...@@ -36,12 +36,11 @@
</td> </td>
<td> <td>
<% @supplies = 0 %> <% @supplies = 0 %>
<% product.transactions.each do |transaction| %> <% product.transactions.each do |trans| %>
<% if trans.mode == "Supply" %> <% if trans.mode == "Supply" %>
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% trans.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @supplies += trans.quantity %> <% @supplies += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
...@@ -49,22 +48,20 @@ ...@@ -49,22 +48,20 @@
</td> </td>
<td> <td>
<% @orders = 0 %> <% @orders = 0 %>
<% product.transactions.each do |transaction| %> <% product.transactions.each do |trans| %>
<% if trans.mode == "ORDER" %> <% if trans.mode == "Order" %>
<% if trans.quantity == nil %>
<% if trans.quantity == nil %> <% trans.quantity == 0 %>
<% transaction.quantity == 0 %>
<% end %> <% end %>
<% @orders += trans.quantity %> <% @orders += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
<%= "(#{@orders.abs})" %> <%= @orders %>
</td> </td>
<td> <td>
<% @total = 0 %> <% @total = 0 %>
<% product.transactions.each do |transaction| %> <% product.transactions.each do |trans| %>
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% trans.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @total += trans.quantity %> <% @total += trans.quantity %>
...@@ -94,9 +91,9 @@ ...@@ -94,9 +91,9 @@
<% end%> <% end%>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>
<% else %> <% elsif user_signed_in? %>
<h1>Transactions</h1> <h1>Transactions</h1>
<br> <br>
...@@ -106,14 +103,13 @@ ...@@ -106,14 +103,13 @@
</small> </small>
<% else %> <% else %>
<table class = "table", cellspacing="0", cellpadding="0"> <table class = "table", cellspacing="0", cellpadding="0">
<thead style="background-color: #333"> <thead style="background-color: #76D7C4">
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
<th>Status</th> <th>Status</th>
<th>Supply</th> <th>Supply</th>
<th>Order</th> <th>Order</th>
<th>Total</th> <th>Total</th>
<th>Created At</th>
<th colspan="6"></th> <th colspan="6"></th>
</thead> </thead>
<tbody> <tbody>
...@@ -135,7 +131,6 @@ ...@@ -135,7 +131,6 @@
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% trans.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @supplies += trans.quantity %> <% @supplies += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
...@@ -144,36 +139,40 @@ ...@@ -144,36 +139,40 @@
<td> <td>
<% @orders = 0 %> <% @orders = 0 %>
<% product.transactions.each do |trans| %> <% product.transactions.each do |trans| %>
<% if trans.mode == "ORDER" %> <% if trans.mode == "Order" %>
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% transaction.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @orders += trans.quantity %> <% @orders += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
<%= "(#{@orders.abs})" %> <%= @orders %>
</td> </td>
<td> <td>
<% @total = 0 %> <% @total = 0 %>
<% product.transactions.each do |trans| %> <% product.transactions.each do |trans| %>
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% trans.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @total += trans.quantity %> <% @total += trans.quantity %>
<% end %> <% end %>
<%= @total %> <%= @total %>
</td> </td>
<td> <td>
<%= link_to "Add Supply", new_product_supply_path(product), class: "btn btn-primary" %> <% if product.status == "Active" %>
</td> <td>
<td> <%= link_to "Add Supply", new_product_supply_path(product), class: "btn btn-primary" %>
<%= link_to "Add Order", new_product_order_path(product), class: "btn btn-primary" %> </td>
<td>
<%= link_to "Add Order", new_product_order_path(product), class: "btn btn-primary" %>
</td>
<% else %>
<% end %>
</td> </td>
</tr> </tr>
<% end %> <% end%>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>
<% end %> <% end %>
>>>>>>> 6e6754882451c54a2f4e7f2bf5f24cb6d6b1d826
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%= simple_form_for @product do |f| %> <%= simple_form_for @product do |f| %>
<%= f.input :name %> <%= f.input :name %>
<%= f.input :description, as: :text %> <%= f.input :description, as: :text %>
<%= f.input :status, as: :radio_buttons, collection: [['Active', 'Active'], ['Inactive', 'Inactive']], value_method: :first, label_method: :second %>
<%= f.button :submit, "Create Product", class: "btn btn-primary" %> <%= f.button :submit, "Create Product", class: "btn btn-primary" %>
<%= link_to "Back", products_path, class: "btn btn-default" %> <%= link_to "Back", products_path, class: "btn btn-default" %>
<% end %> <% end %>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3>Admin User Log In</h3> <h3>Admin</h3>
<%= simple_form_for :admin_user, url: session_path(:admin_user) do |f| %> <%= simple_form_for :admin_user, url: session_path(:admin_user) do |f| %>
<%= f.input :email %> <%= f.input :email %>
<%= f.input :password %> <%= f.input :password %>
...@@ -10,16 +10,18 @@ ...@@ -10,16 +10,18 @@
</div> </div>
<div class="col"> <div class="col">
<h3>User Log In</h3> <h3>User</h3>
<%= simple_form_for :user, url: session_path(:user) do |f| %> <%= simple_form_for :user, url: session_path(:user) do |f| %>
<%= f.input :email %> <%= f.input :email %>
<%= f.input :password %> <%= f.input :password %>
<%= f.submit 'Log In', class: 'btn btn-info' %> <%= f.button :submit, "Log In", as: :authenticated_user, class: 'btn btn-info' %>
<%= link_to "Sign Up", new_user_registration_path, :class => 'navbar-link' %> <%= link_to "Sign Up", new_user_registration_path, :class => 'navbar-link' %>
<% end %> <% end %>
</div> </div>
</div>
<!-- <body style = "background-image: url(http://www.sunrisecatalogue.com/uploads/posters/duovsvt_ldlcw_YYSRSRC.jpg); background-size: 100%">
</body> -->
</div>
......
<h1>New Supply</h1> <h1>New Supply</h1>
<%= simple_form_for @post do |f| %> <%= simple_form_for([@product, @supply], url: product_supplies_path) do |f| %>
<%= f.input :quantity, as: :integer %> <%= f.input :quantity %>
<%= f.button :submit, "Add Supply", class: "btn btn-info" %> <%= f.button :submit, "Add Supply", class: "btn btn-primary" %>
<%= link_to "Back", transaction_path, class: "btn btn-default" %> <%= link_to "Back", authenticated_user_root_path, class: "btn-btn-default" %>
<% end %> <% end %>
Rails.application.routes.draw do Rails.application.routes.draw do
get 'orders/new'
get 'supplies/new'
devise_for :admin_users devise_for :admin_users
devise_scope :admin_user do devise_scope :admin_user do
authenticated :admin_user do authenticated :admin_user do
......
...@@ -6,9 +6,4 @@ class OrdersControllerTest < ActionDispatch::IntegrationTest ...@@ -6,9 +6,4 @@ class OrdersControllerTest < ActionDispatch::IntegrationTest
assert_response :success assert_response :success
end end
test "should get create" do
get orders_create_url
assert_response :success
end
end end
require 'test_helper' require 'test_helper'
class SuppliesControllerTest < ActionDispatch::IntegrationTest class SuppliesControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get supplies_index_url
assert_response :success
end
test "should get new" do test "should get new" do
get supplies_new_url get supplies_new_url
assert_response :success assert_response :success
end end
test "should get create" do
get supplies_create_url
assert_response :success
end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment