Sha256: 460215bd5295350f1f91a258d26a291a5d16b1d57bdea1f1736b474c6ca9a56b

Contents?: true

Size: 1.99 KB

Versions: 5

Compression:

Stored size: 1.99 KB

Contents

<% title "User: " + @user.first_name + " " + @user.last_name %>


<p>
  This <strong>edit mode demo app</strong> shows how <a href="https://github.com/fiedl/edit_mode" target="_blank">edit_mode</a> looks like.
</p>
<p>
  You can either click on the information to directly edit them via <a href="https://github.com/bernat/best_in_place" target="_blank">best_in_place</a>, or you can use the 'edit' links to activate the edit mode.
</p>

<div class="edit_mode_group">
  <span class="edit_mode_tools">
    <a class="edit_button" href="#">edit</a>
    <a class="cancel_button" href="#">cancel</a>
    <a class="save_button" href="#">save</a>
  </span>

  <h2>Basic Information</h2>
  <p>
    <strong>First Name:</strong>
    <%= best_in_place @user, :first_name %>
  </p>
  <p>
    <strong>Last Name:</strong>
    <%= best_in_place @user, :last_name %>
  </p>
</div>

<div class="edit_mode_group">
  <span class="edit_mode_tools">
    <a class="edit_button" href="#">edit</a>
    <a class="cancel_button" href="#">cancel</a>
    <a class="save_button" href="#">save</a>
  </span>

  <h2>Markdown Description</h2>
  <%= best_in_place @user, :description, display_with: :markdown, type: :textarea %>
</div>

<div class="edit_mode_group">
  <span class="edit_mode_tools">
    <a class="edit_button" href="#">edit</a>
    <a class="cancel_button" href="#">cancel</a>
    <a class="save_button" href="#">save</a>
  </span>

  <h2>Additional Information</h2>
  <p>
    <strong>Date Of Birth:</strong>
    <%= best_in_place @user, :date_of_birth %>
    <span class="show_only_in_edit_mode"><a href="#" title="this link does not do anything in this demo.">delete</a></span>
  </p>
  <span class="show_only_in_edit_mode">
    <a href="#" title="this link does not do anything in this demo.">add</a>
  </span>
</div>

<p class="global_tools">
  <!--
    <%= link_to "Edit", edit_user_path(@user) %> |
    <%= link_to "Destroy", @user, :confirm => 'Are you sure?', :method => :delete %> |
  -->
  <%= link_to "View All Users", users_path %>
</p>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
edit_mode-1.0.5 test_app/app/views/users/show.html.erb
edit_mode-1.0.4 test_app/app/views/users/show.html.erb
edit_mode-1.0.3 test_app/app/views/users/show.html.erb
edit_mode-1.0.2 test_app/app/views/users/show.html.erb
edit_mode-1.0.1 test_app/app/views/users/show.html.erb