Feature/64 activity search

search box clean up done. good to go.
Generally that's not how empty search results are handled. You see the
results page and it says "no results found" It doesn't redirect you back.
Eg: Google doesn't redirect you back to the home page if your results are
empty. It shows you a message where the results would be saying "nothing
found" or something.

Khurram Virani


On Sun, Jun 8, 2014 at 6:04 PM, ReNet <notifications@github.com> wrote:

> In app/controllers/activities_controller.rb:
>
> > @@ -8,4 +8,12 @@ def show
> >      @previous_activity = @activity.previous
> >    end
> >
> > +  def search
> > +    @activities = Activity.search(params[:query])
> > +    if @activities.nil?
> > +    	flash[:alert] = "No results for your search request."
> > +    	redirect_to :back
>
> Thank you Khurram, not sure I follow.... I thought that what you are
> requesting is what we implemented. The code makes the user stay on the page
> from which he/she is searching if the search-results are empty and a
> message is flashed to explain. Q: not sure why it is better to implement
> this at the view level? We thought that implementing this at the controller
> ev
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/lighthouse-labs/laser_shark/pull/53/files#r13527499>.
>