title: how to use 'select limit 1' in rails 4.1
body: <p>I want to use this code:
  <code>select id from categories where hotel_id=4 limit 1</code></p>
  
  <p>I am new in rails. How do i use <code>activerecord</code> in controller to achieve the same result as the above code.
  I already have <code>hotel_id</code> in <code>params</code> in my controller.</p>