|
1 | 1 | <!-- Search Bar --> |
2 | 2 | <div class="input-group" id="adv-search"> |
3 | | - <input type="text" class="form-control" placeholder="Search...."/> |
| 3 | + <%= form_tag(root_url, :method => "get", id: "search-form") do %> |
| 4 | + <%= text_field_tag :search, params[:search], placeholder: "Search..." %> |
| 5 | + <%= submit_tag "Search" %> |
| 6 | + <% end %> |
| 7 | + <!-- <input type="text" class="form-control" placeholder="Search...."/> |
4 | 8 | <div class="input-group-btn"> |
5 | 9 | <div class="btn-group" role="group"> |
6 | | - <div class="dropdown dropdown-lg"> |
7 | | - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
| 10 | + <div class="dropdown dropdown-lg"> --> |
| 11 | + <!-- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
8 | 12 | <span class="caret"></span></button> |
9 | 13 | <div class="dropdown-menu dropdown-menu-right" role="menu"> |
10 | 14 | <form class="form-horizontal" role="form"> |
|
28 | 32 | <button type="submit" class="btn btn-primary"> |
29 | 33 | <span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> |
30 | 34 | </form> |
31 | | - </div> |
32 | | - </div> |
| 35 | + </div> --> |
| 36 | + <!-- </div> |
33 | 37 | <button type="button" class="btn btn-primary"> |
34 | 38 | <span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> |
35 | 39 | </div> |
36 | | - </div> |
| 40 | + </div> --> |
37 | 41 | </div> |
38 | 42 |
|
39 | 43 | <!-- Only Admin is allowed to create new products --> |
|
49 | 53 | <%= will_paginate @products %> |
50 | 54 |
|
51 | 55 | <ul class="users"> |
52 | | -<%= render @products %> |
53 | | -<%# @products.each do |product| %> |
54 | | - <%#= render 'shared/product' , product: product %> |
55 | | - <%# end %> |
56 | | - </ul> |
| 56 | + <% if @products.present? %> |
57 | 57 |
|
58 | | - <%= will_paginate @products %> |
59 | | - <br> |
| 58 | + <%= render @products %> |
| 59 | + <%# @products.each do |product| %> |
| 60 | + <%#= render 'shared/product' , product: product %> |
| 61 | + <%# end %> |
| 62 | + </ul> |
| 63 | + |
| 64 | + <%= will_paginate @products %> |
| 65 | + |
| 66 | + <% else %> |
| 67 | + <p>There are no posts containing the term(s) |
| 68 | + <%= params[:search] %>.</p> |
| 69 | + <% end %> |
| 70 | + <br> |
0 commit comments