Skip to content

Instantly share code, notes, and snippets.

@ericallam
Created August 26, 2011 16:37
Show Gist options
  • Save ericallam/1173823 to your computer and use it in GitHub Desktop.
Save ericallam/1173823 to your computer and use it in GitHub Desktop.
Rails for Zombies 2 – Challenge 5-9
<p id="notice"><%= notice %></p>
<ul>
<li>
<em>Name:</em>
<%= @weapon.name %>
</li>
<li>
<em>Condition:</em>
<span id="condition"><%= @weapon.condition %></span>
<%= link_to "Toggle", toggle_condition_user_weapon_path(@user, @weapon), remote: true %>
</li>
<li>
<em>Ammo:</em>
<span id="ammo"><%= @weapon.ammo %></span>
</li>
</ul>
<div id="reload_form">
<%= form_for [@user, @weapon], url: reload_user_weapon_path(@user, @weapon) do |f| %>
<div class="field">
Number of bullets to reload:
<%= number_field_tag :ammo_to_reload, 30 %> <br />
<%= f.submit "Reload" %>
</div>
<% end %>
</div>
<%= link_to 'Edit', edit_weapon_path(@weapon) %> |
<%= link_to 'Back', weapons_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment