title: simple-form grouped collection select for has many through association
body: <p>I have three models as shown</p>
  
  <pre><code>class Location &lt; ActiveRecord::Base
    attr_accessible :location_name
    has_many :areas
    has_many :restaurants, through: :areas
  end
  
  class Area &lt; ActiveRecord::Base
    attr_accessible :area_name, :location_id
    belongs_to :location
    has_many :restaurants
  end
  
  class Restaurant &lt; ActiveRecord::Base
    attr_accessible  :description, :menu, :restaurant_name, :area_id
    belongs_to :area
  end
  </code></pre>
  
  <p>Am using simple-form gem and i want create a new restaurant and select a Location first which has many areas and the correct areas associated with a location to be automatically selected. Then i narrow down to a single area. Similar in concept to say how someone would select Continents and then be narrowed down to a country in a particular continent. Is there a way to achieve this using simple_form.?
  Do i have anything extra to the new action in the restaurant controller? </p>
  
  <p>This is my view so far for creating a new restaurant</p>
  
  <pre><code>&lt;%= simple_form_for @restaurant do |f| %&gt;
  &lt;%= f.input :restaurant_name %&gt;
  &lt;%= f.input :description %&gt;
  &lt;%= f.input :menu %&gt;
  &lt;%= f.input :area_id,collection: @locations, as: :grouped_select, group_method: :areas%&gt;
  &lt;%= f.button :submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>This doesnot work as expected. I have already populated my database with Locations and Areas. Any ideas?</p>