I am having a search form on my index page that redirects to a page that shows all statuses with the params given by search. Now I want to put in a flash notice if the page is blank because the search param doesn't fit to any of my statuses. any idea? greetz
Flash[:notice] if page.blank?
196 views Asked by user3079933 At
4
There are 4 answers
0
On
def search_status
@search = User.find_by_status(params[:status])
if [email protected]?
flash[:notice] = 'Requested status not available'
rediret_to '/Index'
end
end
This should be ok:
More info about
flashhere: http://guides.rubyonrails.org/action_controller_overview.html#the-flash