Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Search</h1>
- <div id="search" style="width:400px; margin:0 auto;">
- <% form_for('/search') do %>
- <div>
- <label for="query">Search For:</label>
- <%= text_field_tag 'query', h(params[:query]), :size => 35 %>
- <%= submit_tag 'Search' %>
- </div>
- <div>
- <label for="type">Type:</label>
- <%= select_tag('type', options_for_select({:Book => 'book', :Tutor => 'tutor'}, params[:type])) %>
- <label for="wanted">For Sale:</label>
- <%= radio_button_tag 'for_sale', true, (params[:for_sale].nil? || params[:for_sale] == 'true' ? true : false) %>
- <label for="wanted">Wanted:</label>
- <%= radio_button_tag 'for_sale', false, params[:for_sale] == 'false' ? true : false %>
- </div>
- <% end %>
- </div>
- <div id="results">
- <% if @result.size > 0 %>
- <% @results.each do |result| %>
- <div class="results">
- <h3><%= link_to(h(result.title), :controller => 'search', :action => 'view', :id => result.id) %></h3>
- <p>Price: $<%= result.price -%></p>
- <p><%=h result.description %></p>
- </div>
- <% end %>
- <% else %>
- <p>No results.</p>
- <% end %>
- </div>
Add Comment
Please, Sign In to add comment