Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- before_filter :foos, :only => "index"
- def index
- if @search
- @foo = @search
- elsif @scope
- @foo = @search.foos
- else
- @foo = Foo.all
- end
- end
- private
- def foos
- if params[:search]
- @search = Foo.search(params[:search])
- end
- end
Add Comment
Please, Sign In to add comment