Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Last active December 15, 2015 21:59
Show Gist options
  • Save px-amaac/5329319 to your computer and use it in GitHub Desktop.
Save px-amaac/5329319 to your computer and use it in GitHub Desktop.
Bootstrap stuff from appscomposer--its crap see my replacement code.
<%-# from users/indes.html.erb -%>
<a data-toggle="modal" href="#role-options-<%= user.id %>" class="btn btn-mini" type="button">Change role</a>
<%-# from users/_user.html.erb -%>
<div id="role-options-<%= user.id %>" class="modal" style="display: none;">
<%= simple_form_for user, :url => user_path(user), :html => {:method => :put, :class => 'form-horizontal' } do |f| %>
<div class="modal-header">
<a class="close" data-dismiss="modal">&#215;</a>
<h3>Change Role</h3>
</div>
<div class="modal-body">
<%= f.input :role_ids, :collection => Role.all, :as => :radio_buttons, :label_method => lambda {|t| t.name.titleize}, :label => false, :item_wrapper_class => 'inline', checked: user.role_ids.first %>
</div>
<div class="modal-footer">
<%= f.submit "Change Role", :class => "btn" %>
<a class="btn" data-dismiss="modal" href="#">Close</a>
</div>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment