title: Howto pass vars from before_filter to view
body: <p>I was wondering how to pass @current_day and @has_day to my view?</p>
  
  <pre><code>class PostController &lt; ApplicationController
    before_filter :detect_current_day
  
    def index
      #some logic
    end
  
   private
  
   def detect_current_day
      if (params[:year] &amp;&amp; params[:month] &amp;&amp; params[:day])
        @current_day =  Date.parse params.values_at(:year, :month, :day).join('.')
      else
        @current_day = Date.today;
      end
  
      # Check if day already exist
      @hasToday = Post.created_on(@current_day).count &gt; 0 ? true : false;
    end
  
  end
  </code></pre>
  
  <p>Thanks</p>