work on refactoring search

This commit is contained in:
albert
2013-01-08 15:53:21 -05:00
parent 80f34d08d9
commit 13271e9bf5
19 changed files with 152 additions and 45 deletions

View File

@@ -18,8 +18,7 @@ class ArtistsController < ApplicationController
end
def index
@search = Artist.search(params[:search])
@artists = @search.paginate(params[:page])
@artists = Artist.search(params[:search]).paginate(params[:page])
respond_with(@artists) do |format|
format.xml do
render :xml => @artists.to_xml(:include => [:urls])
@@ -31,7 +30,6 @@ class ArtistsController < ApplicationController
end
def search
@search = Artist.search(params[:search])
end
def show

View File

@@ -71,8 +71,7 @@ private
end
def index_by_comment
@search = Comment.search(params[:search])
@comments = @search.paginate(params[:page])
@comments = Comment.search(params[:search]).paginate(params[:page])
respond_with(@comments) do |format|
format.html {render :action => "index_by_comment"}
end