title: Controller private method not working
body: <p>I am building an app where users can post. Each post an be upvoted and downvoted. Where the posts are displayed, I have a little  form that allows the user to filter the posts. It simply passes a paramter to url called params[:post_filter] (localhost:3000/somepage?post_filter=value). Now, this works just fine and dandy, except the private method I wrote to modify the query does not work.</p>
  
  <p>Here is my query:</p>
  
  <pre><code>def room
              @posts = Post.where('lesson_id = ?', params[:id]).order(post_filter_params).page(params[:page]).per(30)
      end
  </code></pre>
  
  <p>and here is my private method:</p>
  
  <pre><code>private
  
  def post_filter_params
      chosen_option = params[:post_filter].to_i == 1 or 2 or 3 ? params[:post_filter] : '1'
      case chosen_option
      when 1
          'created_at DESC'
      when 2
          'upvotes DESC'
      when 3
          'downvotes DESC'
      end
  end
  </code></pre>
  
  <p>Now, whenever I replace the .order() value with one of the strings in my private method, everything works as planned. However, placing private method name inside the .order() value does not work. Any ideas for what is going on?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To make sure all values are the same data type I did this but it still does not work:</p>
  
  <pre><code>def post_filter_params
      param_option = params[:post_filter].to_i
      chosen_option = param_option == 1 or 2 or 3 ? param_option : 1
      case chosen_option
      when 1
          'created_at DESC'
      when 2
          '(upvotes - downvotes) DESC'
      when 3
          'downvotes DESC'
      end
  end
  </code></pre>