title: How to redirect to another controller action in ruby on rails
body: <p>I have two controllers <code>search</code> and <code>tweet</code>: </p>
  
  <p>I am in search and I want to go to tweets controller index action to list all tweet in DB. I tried many things with <code>redirect_to</code> but it did not work. I usually get this error <code>NoMethodError in Home#search</code>.</p>
  
  <p>search.html.erb:</p>
  
  <pre><code>&lt;%=client.search("#{params[:search]}", result_type: "recent").take(5).collect do |tweet| %&gt;
      &lt;% @tweeter = Tweeter.new(image: tweet.user.profile_image_url ,sender: tweet.user.name ,tweet: tweet.full_text ,date: tweet.created_at)%&gt;
      &lt;% @tweeter.save %&gt;
      &lt;%= redirect_to  tweeters_path %&gt;       
  &lt;%end %&gt;  
  </code></pre>
  
  <p>tweet controller:</p>
  
  <pre><code>def index
      @tweeters = Tweeter.all
  end
  </code></pre>
  
  <p>and I get this message:</p>
  
  <p><a href="https://i.stack.imgur.com/48god.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48god.png" alt="enter image description here"></a></p>
  
  <p>NOTE : when I search any thing in twitter the result will be saved in DB and when I type URL <a href="https://xxxxxxxxxxxxxxx.c9users.io/tweeters" rel="nofollow noreferrer">https://xxxxxxxxxxxxxxx.c9users.io/tweeters</a>  all data in DB will be listed. But I want after search to go directly to <a href="https://xxxxxxxxxxxxxxx.c9users.io/tweeters" rel="nofollow noreferrer">https://xxxxxxxxxxxxxxx.c9users.io/tweeters</a></p>