OK, so the trick here is that the “other page” is probably the result of a Rails controller action that usually displays the page at a separate URL, right? But bootstrap assumes that when you click on a link, its HTML already exists on the current page.
, ? AJAX (link_to ... :remote => true - ) , div -. , , , - ( , Bootstrap), , .
EDIT: , ( Devise gem ):
app/views/devise/registrations/_edit.html.erb:
<div class="modal hide fade in" id="user-edit">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h2>Edit User</h2>
</div>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:method => :put}) do |f| %>
<div class="modal-body">
<%= devise_error_messages! %>
<div>
<%= f.label :name %><br/>
<%= f.text_field :name %>
</div>
<div>
<%= f.label :email %><br/>
<%= f.email_field :email %>
</div>
<div>
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br/>
<%= f.password_field :password, :autocomplete => "off" %>
</div>
<div>
<%= f.label :password_confirmation %><br/>
<%= f.password_field :password_confirmation %>
</div>
<div>
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br/>
<%= f.password_field :current_password %>
</div>
</div>
<div class="modal-footer">
<%= f.button "Update", :class => "btn btn-primary", :data => { :dismiss => "modal"} %>
<a href="#" class="btn" data-dismiss="modal">Close</a>
</div>
<% end %>
</div>
app/views/devise/registrations/edit.js.erb:
$("#main").before("<%= escape_javascript(render "edit", :formats => [:html]) %>");
$("#user-edit").modal();
, ( nav:
<li><%= link_to "Edit Account", edit_user_registration_path, :remote => true %></li>