title: Rails - How to access a Request Parameter from view in a helper
body: <p>How do you access a view's request parameter inside a Helper?</p>
  
  <p>My view <code>events/index7</code> sets the parameter date_selected:</p>
  
  <pre><code>&lt;div&gt;&lt;%= link_to 'View' , events_index7_path(:date_selected =&gt; date), :class =&gt; 'btn  btn-mini'%&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My helper is <code>app/helpers/calendar_helper.rb</code></p>
  
  <p>Here's a pic of it at the point in the Helper I where I want to access it.</p>
  
  <p><img src="https://i.stack.imgur.com/VzuYq.png" alt="enter image description here"> </p>
  
  <p>I tried this:</p>
  
  <pre><code>classes &lt;&lt; "dayselect" if day == DateTime.strptime(params[:date_selected], "%Y-%m-%d")
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>undefined local variable or method `params' for #&lt;CalendarHelper::Calendar:0x007f8d215671f0&gt;
  </code></pre>
  
  <p>OR should I be passing the date to the helper in a different way?</p>
  
  <p>Thanks for the help!</p>