%p
  = text_field :name, :label => 'Name'
%p
  = text_field :hostname, :label => 'Hostname'

= fieldset :legend => 'Operating System' do
  = select :operating_system_id, :collection => Locomotive::OperatingSystem.all, :value_method => :id, :text_method => :name

= fieldset :legend => 'Roles' do
  %table
    - # render :partial => "system_role", :collection => Role.all
    - Locomotive::Role.all.each do |role|
      - html_id = 'role_' + role.id.to_s
      %tr
        %td
          = check_box :name => "system[role_ids][]", :boolean => false, :id => html_id, :value => role.id, :checked => @system.roles.include?(role)
        %td
          = label role.name, :for => html_id

%p
  = text_field :name, :label => 'Name'
%p
  = text_field :hostname, :label => 'Hostname'

= fieldset :legend => 'Operating System' do
  = select :operating_system_id, :collection => Locomotive::OperatingSystem.all, :value_method => :id, :text_method => :name, :selected => @system.operating_system_id.to_s

= fieldset :legend => 'Roles' do
  %table
    - # render :partial => "system_role", :collection => Role.all
    - Locomotive::Role.all.each do |role|
      - html_id = 'role_' + role.id.to_s
      %tr
        %td
          = check_box :name => "system[role_ids][]", :boolean => false, :id => html_id, :value => role.id, :checked => @system.roles.include?(role)
        %td
          = label role.name, :for => html_id

Make sure the select form helper displays the right option as selected
Make sure the select form helper displays the right option as selected

* See http://calamitylane.com/articles/programming/select-tag-funkyness-with-merb/

Signed-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>
