title: how to show modal window in controller's action?
body: <p>So I've got controller PagesController with actions index and full_search. Action index is for home page. On home page I've got the button 'search' and text_field. If user types sometiong in text_field and clicks on button 'search' he/she goes to action full_search. In this action I try to find something by user's query. if I don't find anything I should just show a modal window with 'no results' otherwise redirect to another page</p>
  
  <pre><code>def full_search
    ...do search...
    if search_result.empty?
      show modal window with text 'no results'
    else
      redirect to another page
    end
  end
  </code></pre>
  
  <p>How can I show modal window(like function alert in js)? I think I have to use javascript..but where???</p>
  
  <p>if search_result is empty I don't need to render any view...I just need to stay at the same page and show modal window</p>