From 048b3881f9a5b9444ca03bec72dd398ac2b71532 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 31 Aug 2011 15:46:18 -0400 Subject: [PATCH] moving the simple query thingy into a different method/view so that I can turn the index method/view into something more like the Solr builtin browse view --- rails/hamster/app/controllers/solr_controller.rb | 4 +++- rails/hamster/app/views/solr/index.html.erb | 16 +--------------- .../hamster/app/views/solr/simple_query.html.erb | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 rails/hamster/app/views/solr/simple_query.html.erb diff --git a/rails/hamster/app/controllers/solr_controller.rb b/rails/hamster/app/controllers/solr_controller.rb index 57621c9..1148c53 100644 --- a/rails/hamster/app/controllers/solr_controller.rb +++ b/rails/hamster/app/controllers/solr_controller.rb @@ -5,7 +5,7 @@ require 'rexml/document' class SolrController < ApplicationController include SolrHelper - def index + def simple_query @search = request[:q] @results = [] if @search != nil @@ -13,4 +13,6 @@ class SolrController < ApplicationController end end + def index + end end diff --git a/rails/hamster/app/views/solr/index.html.erb b/rails/hamster/app/views/solr/index.html.erb index d47c07e..18121c5 100644 --- a/rails/hamster/app/views/solr/index.html.erb +++ b/rails/hamster/app/views/solr/index.html.erb @@ -1,15 +1 @@ -

Find Stuff!

- -
- "/> - -
- -<% if @results.length %> -

Results for “<%= @search %>”:

- -<% end %> +

Index

diff --git a/rails/hamster/app/views/solr/simple_query.html.erb b/rails/hamster/app/views/solr/simple_query.html.erb new file mode 100644 index 0000000..5851caf --- /dev/null +++ b/rails/hamster/app/views/solr/simple_query.html.erb @@ -0,0 +1,16 @@ + +

Find Stuff!

+ +
+ "/> + +
+ +<% if @results.length %> +

Results for “<%= @search %>”:

+ +<% end %>