title: "ArgumentError Exception: Unknown key" with a find_by
body: <p>I have a coupon system, and I'm trying to get the <code>coupon</code> object with the method <code>find_by</code>:</p>
  
  <pre><code>Coupon.find_by_coupon(params[:coupon])
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>ArgumentError Exception: Unknown key: coupon
  </code></pre>
  
  <p>I'm sure <code>params[:coupon]</code> is right:</p>
  
  <pre><code>(rdb:1) eval params[:coupon]
  {"coupon"=&gt;"100"}
  </code></pre>
  
  <p>I have the following model:</p>
  
  <pre><code># Table name: coupons
  #
  #  id              :integer         not null, primary key
  #  coupon          :string(255)
  #  user_id         :integer
  </code></pre>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>It's working if I put <code>Coupon.find_by_coupon(params[:coupon][:coupon])</code> instead of <code>Coupon.find_by_coupon(params[:coupon])</code>.</p>
  
  <p>Here the code with the form in my view:</p>
  
  <pre><code>&lt;%= semantic_form_for Coupon.new, url: payment_summary_table_offers_path(@booking_request) do |f| %&gt;
      &lt;%= f.input :coupon, :as =&gt; :string, :label =&gt; false, no_wrapper: true %&gt;
      &lt;%= f.action :submit, :as =&gt; :button, :label =&gt; t(:button_use_coupon), no_wrapper: true,
      button_html: { value: :reply, :disable_with =&gt; t(:text_please_wait) } %&gt;
  &lt;% end %&gt;
  </code></pre>