_form.html.erb 1.4 KB

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