--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Returns <tt>&lt;select&gt;</tt>, <tt>&lt;optgroup&gt;</tt> and <tt>&lt;option&gt;</tt> tags for the collection of existing return values of <tt>method</tt> for <tt>object</tt>'s class. The value returned from calling <tt>method</tt> on the instance <tt>object</tt> will be selected. If calling <tt>method</tt> returns <tt>nil</tt>, no selection is made without including <tt>:prompt</tt> or <tt>:include_blank</tt> in the <tt>options</tt> hash.
- !ruby/struct:SM::Flow::P 
  body: "Parameters:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>object</tt> - The instance of the class to be used for the select tag
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>method</tt> - The attribute of <tt>object</tt> corresponding to the select tag
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>collection</tt> - An array of objects representing the <tt>&lt;optgroup&gt;</tt> tags.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>group_method</tt> - The name of a method which, when called on a member of <tt>collection</tt>, returns an array of child objects representing the <tt>&lt;option&gt;</tt> tags.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>group_label_method</tt> - The name of a method which, when called on a member of <tt>collection</tt>, returns a string to be used as the <tt>label</tt> attribute for its <tt>&lt;optgroup&gt;</tt> tag.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>option_key_method</tt> - The name of a method which, when called on a child object of a member of <tt>collection</tt>, returns a value to be used as the <tt>value</tt> attribute for its <tt>&lt;option&gt;</tt> tag.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>option_value_method</tt> - The name of a method which, when called on a child object of a member of <tt>collection</tt>, returns a value to be used as the contents of its <tt>&lt;option&gt;</tt> tag.
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: "Example object structure for use with this method:"
- !ruby/struct:SM::Flow::VERB 
  body: "  class Continent &lt; ActiveRecord::Base\n    has_many :countries\n    # attribs: id, name\n  end\n  class Country &lt; ActiveRecord::Base\n    belongs_to :continent\n    # attribs: id, name, continent_id\n  end\n  class City &lt; ActiveRecord::Base\n    belongs_to :country\n    # attribs: id, name, country_id\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "Sample usage:"
- !ruby/struct:SM::Flow::VERB 
  body: "  grouped_collection_select(:city, :country_id, @continents, :countries, :name, :id, :name)\n"
- !ruby/struct:SM::Flow::P 
  body: "Possible output:"
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;select name=&quot;city[country_id]&quot;&gt;\n    &lt;optgroup label=&quot;Africa&quot;&gt;\n      &lt;option value=&quot;1&quot;&gt;South Africa&lt;/option&gt;\n      &lt;option value=&quot;3&quot;&gt;Somalia&lt;/option&gt;\n    &lt;/optgroup&gt;\n    &lt;optgroup label=&quot;Europe&quot;&gt;\n      &lt;option value=&quot;7&quot; selected=&quot;selected&quot;&gt;Denmark&lt;/option&gt;\n      &lt;option value=&quot;2&quot;&gt;Ireland&lt;/option&gt;\n    &lt;/optgroup&gt;\n  &lt;/select&gt;\n"
full_name: ActionView::Helpers::FormOptionsHelper#grouped_collection_select
is_singleton: false
name: grouped_collection_select
params: (object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {})
visibility: public
