Search
<%= form_tag "/search", :method => :get do %>
<%= text_field_tag "q", @search.q, :size => 40 %>
<%= radio_button_tag "what", "all", @search.what == "all" %>   <%= radio_button_tag "what", "stories", @search.what == "stories" %>   <%= radio_button_tag "what", "comments", @search.what == "comments" %>
<%= radio_button_tag "order", "relevance", @search.order == "relevance" %>   <%= radio_button_tag "order", "newest", @search.order == "newest" %>   <%= radio_button_tag "order", "points", @search.order == "points" %>
<% end %>
<% if @search.results.any? %>

<%= @search.total_results %> result<%= @search.total_results == 1 ? "" : "s" %> for "<%= @search.q %>"

    <% @search.results.each do |res| %> <% if res.class == Story %> <%= render :partial => "stories/listdetail", :locals => { :story => res } %> <% elsif res.class == Comment %> <%= render :partial => "comments/comment", :locals => { :comment => res, :story => res.story, :show_story => true, :hide_voters => true } %> <% end %> <% end %>
<% if @search.total_results > @search.per_page %> <% end %> <% end %>