_form.html.erb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <%= form_for(@user_credential, :method => @user_credential.new_record? ? "POST" : "PUT") do |f| %>
  2. <% if @user_credential.errors.any? %>
  3. <div class="row well">
  4. <h2><%= pluralize(@user_credential.errors.count, "error") %> prohibited this Credential from being saved:</h2>
  5. <% @user_credential.errors.full_messages.each do |msg| %>
  6. <p class='text-warning'><%= msg %></p>
  7. <% end %>
  8. </div>
  9. <% end %>
  10. <div class="row">
  11. <div class="col-md-4">
  12. <div class="form-group">
  13. <%= f.label :credential_name %>
  14. <%= f.text_field :credential_name, :class => 'form-control' %>
  15. </div>
  16. <div class="form-group">
  17. <%= f.label :mode %>
  18. <%= f.select :mode, options_for_select(UserCredential::MODES.map {|s| [s.classify, s] }, @user_credential.mode), {}, :class => 'form-control' %>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="row">
  23. <div class="col-md-12">
  24. <div class="form-group">
  25. <%= f.label :credential_value %>
  26. <%= f.text_area :credential_value, :class => 'form-control', :rows => 10 %>
  27. <div id="ace-credential-value"></div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col-md-12">
  33. <div class='form-actions' style='clear: both'>
  34. <%= f.submit "Save Credential", :class => "btn btn-primary" %>
  35. </div>
  36. </div>
  37. </div>
  38. <% end %>
  39. <%= javascript_include_tag "user_credentials" %>