title: Can I use redirect_to in a view in RoR?
body: <p>In my app, I've got a little box that appears on every page, checking on the status of requests made by the user. If a request is accepted at any time, then the user should automatically be taken to a certain page. This is my code so far:</p>
  
  <pre><code> &lt;% offersMade.each do |w| %&gt;
    &lt;% if w.accepted == true %&gt;
     &lt;% redirect_to offer_path(:email =&gt; "email@gmail.com") %&gt;
    &lt;% end %&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>But I'm getting this error:</p>
  
  <pre><code>undefined method `redirect_to' for #&lt;ActionView::Base:0x1042a9770&gt;
  </code></pre>
  
  <p>Is it not possible to user redirect_to in a view? If not, is there something else I can use? Thanks for reading.</p>