%fieldset#provider_type
  = label_tag "Provider: "
  = select(:provider_account, :provider_id, options_for_select(@providers.map{ |p| [p.name, p.id] }, :selected => @selected_provider.id))
  = restful_submit_tag "Choose", 'set_selected_provider',set_selected_provider_provider_accounts_path, 'GET', :class => 'button'
  = label_tag "Cloud type: "
  = @selected_provider.provider_type.name
  - unless @selected_provider.provider_type.codename.nil?
    = render :partial => "provider_form", :locals => { :provider_type => @selected_provider.provider_type}
  - else
    = flash.now[:warning] = "You don't have any provider yet"

:javascript
  $(document).ready(function(){
      var selected_provider;
      $("#provider_account_provider_id").change(function()
      {
          selected_provider = $("option:selected").attr('value');
          $.get("#{set_selected_provider_provider_accounts_url}", {'provider_account[provider_id]':selected_provider},
            function(result) {
              $("#provider_type").html(result);
            }
          );

       });
  });

%fieldset#provider_type
  = label_tag "Provider: "
  = select(:provider_account, :provider_id, options_for_select(@providers.map{ |p| [p.name, p.id] }, :selected => @selected_provider.id))
  = restful_submit_tag "Choose", 'set_selected_provider',set_selected_provider_provider_accounts_path, 'GET', :class => 'button'
  = label_tag "Cloud type: "
  = @selected_provider.provider_type.name
  - unless @selected_provider.provider_type.codename.nil?
    = render :partial => "provider_form", :locals => { :provider_type => @selected_provider.provider_type}
  - else
    = flash.now[:warning] = "You don't have any provider yet"

:javascript
  $(document).ready(function(){
      var selected_provider;
      $("#provider_account_provider_id").change(function()
      {
          selected_provider = $(this).find("option:selected").attr('value');
          $.get("#{set_selected_provider_provider_accounts_url}", {'provider_account[provider_id]':selected_provider},
            function(result) {
              $("#provider_type").html(result);
            }
          );

       });
  });

Fix JS method for selecting Provider in New ProviderAccount view
Fix JS method for selecting Provider in New ProviderAccount view
