Commit 3091dad8

mo khan <mo@mokhan.ca>
2014-10-19 01:48:53
search by cakes or category.
1 parent b4dd5f1
Changed files (2)
app
app/views/cakes/index.html.erb
@@ -1,5 +1,5 @@
 <% provide(:description, "CakeSide is a free site to share your cake creations and ideas with other cake fanatics like yourself") -%>
-<% provide(:search_path, cakes_path) %>
+<% provide(:search_path, request.env['PATH_INFO'] || cakes_path) %>
 <% unless user_signed_in?  -%>
   <div class="row-fluid">
     <div class="span6">
app/views/layouts/_header.html.erb
@@ -10,7 +10,7 @@
       <div class="nav-collapse collapse">
         <ul class="nav">
           <li>
-            <%= form_tag(yield(:search_path) || search_path, method: :get, name: "search", class: "navbar-search pull-left") do %>
+            <%= form_tag(yield(:search_path).blank? ? search_path : yield(:search_path), method: :get, name: "search", class: "navbar-search pull-left") do %>
               <%= text_field_tag :q, params[:q], class: 'search-query', placeholder: 'Search' %>
             <% end %>
           </li>