title: Rails - List a all items method in controller
body: <p>I need to list all my lawns in one page and then all my bookings in another page. I am writing a method in my controller to list my all items in my database but the problem is either it displays 1 in the view or it produces an inheritance error(in the view) . What I have so far is a lawn that has_many bookings (should actually be has one booking) and a booking which belongs to a lawn and everything is controlled through Activeadmin. The error I get is </p>
  
  <blockquote>
    <p>undefined method `description' for
    Lawn::ActiveRecord_Relation:0x007f4451b00a58> I have modified the error a little bit so it can show over here.</p>
  </blockquote>
  
  <p>Here is my controller code. A lawn has a title and a description so I am not sure why I get the error. I have put 2 different methods for lawn and booking but they are both not working. Here is my controller.</p>
  
  <pre><code>def display_lawns
      @lawn = Lawn.all
    end
  
    def display_status
      @lawn = Lawn.where("selected = ?", "true")
      @bookings = @lawn.booking
    end
  </code></pre>
  
  <p>And here is my view file which does not seem to work with the Lawn.all I also have a similar view file for the bookings with a few changes.</p>
  
  <pre><code>&lt;h2&gt;&lt;%= @lawn.description %&gt;&lt;/h2&gt;
  &lt;ul&gt;
    &lt;% @lawn.bookings.each do |booking| %&gt;
      &lt;li&gt;
        &lt;%= booking.description %&gt;
        &lt;%= button_to "Select", update_booking_path(booking_id: booking), remote: true %&gt;
      &lt;/li&gt;
    &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>