1- <!-- Search Bar -->
2- < div class ="input-group " id ="adv-search ">
3- <%= form_tag ( root_url , :method => "get" , id : "search-form" ) do %>
4- <%= text_field_tag :search , params [ :search ] , placeholder : "Search..." , class : "form-control" %>
5- <%= submit_tag "Search" , class : "form_submit" %>
6- <% end %>
71<!-- <input type="text" class="form-control" placeholder="Search...."/> <div class="input-group-btn"> <div class="btn-group" role="group"> <div class="dropdown dropdown-lg"> -->
82<!-- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <span class="caret"></span></button> <div class="dropdown-menu dropdown-menu-right" role="menu"> <form class="form-horizontal"
93role="form"> <div class="form-group"> <label for="filter">Filter by</label> <select class="form-control"> <option value="0">Featured</option> <option value="1">Most popular</option> <option value="2" selected="selected">Top rated</option> <option
104value="3">Most commented</option> </select> </div> <div class="form-group"> <label for="contain">Top Seller</label> <input class="form-control" type="text"/> </div> <div class="form-group"> <label for="contain">Contains the words</label> <input
115class="form-control" type="text"/> </div> <button type="submit" class="btn btn-primary"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> </form> </div> -->
126<!-- </div> <button type="button" class="btn btn-primary"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> </div> </div> -->
13- </ div >
14-
15- <%= will_paginate @products %>
16-
17- < div >
18- <!-- Only Admin is allowed to create new products -->
19- <% if logged_in? && current_user . admin? %>
20- <%= link_to new_product_path , class : "btn btn-success" , style : "margin-top:15px;" do %>
21- < i class ="glyphicon glyphicon-plus " style ="color:black; "> </ i >
22- Create New Product (Admin)
23- <% end %>
24- <% end %>
257
8+ < div class ="center jumbotron ">
269 < h2 >
27- <% if params [ :search ] . nil? || params [ :search ] . empty? %>
28- All Products (<%= @products . count %> )
10+ <% if params [ :search ] . nil? || params [ :search ] . empty? %>
11+ All Orders (<%= @products . count %> )
2912 <% else %>
3013 Found => [
31- <%= pluralize ( @products . count , " ] Products " ) %>
14+ <%= pluralize ( @products . count , " ] Product " ) %>
3215 <% end %>
3316 </ h2 >
17+
18+ <!-- Search Bar -->
19+ < div class ="input-group " id ="adv-search ">
20+ <%= form_tag ( root_url , :method => "get" , id : "search-form" ) do %>
21+ <%= text_field_tag :search , params [ :search ] , placeholder : "Search..." , class : "form-control" %>
22+ <%= submit_tag "Search" , class : "form_submit" %>
23+ <% end %>
3424</ div >
3525
26+ <!-- Only Admin is allowed to create new products -->
27+ <% if logged_in? && current_user . admin? %>
28+ <%= link_to new_product_path , class : "btn btn-success" , style : "margin-top:15px;" do %>
29+ < i class ="glyphicon glyphicon-plus " style ="color:black; "> </ i >
30+ Create New Product (Admin)
31+ <% end %>
32+ <% end %>
33+ </ div >
34+
35+ <%= will_paginate @products %>
36+
3637
3738< ul class ="users ">
3839<% if @products . present? %>
@@ -47,9 +48,10 @@ class="form-control" type="text"/> </div> <button type="submit" class="btn btn-p
4748
4849 <% else %>
4950 < p >
50- < br /> < br /> < hr />
51- There are no products containing the term(s)
52- => [ < strong > <%= params [ :search ] %> </ strong > ] .
51+ < br /> < br /> < hr />
52+ There are no products containing the term(s) => [
53+ < strong > <%= params [ :search ] %> </ strong >
54+ ] .
5355
5456 </ p>
5557 <% end %>
0 commit comments