Handling mash creation, removing some unnecessary controller methods, redirecting some others to :action => 'new'.

This commit is contained in:
Dan Buch
2012-03-07 13:46:19 -05:00
parent b1e17869b1
commit 70d0a835ed
2 changed files with 25 additions and 63 deletions

View File

@@ -1,24 +1,24 @@
<h1>New mash</h1>
<h1>Mash the Maps!</h1>
<p>Choose your fave.</p>
<% form_for(@mash) do |f| %>
<%= f.error_messages %>
<div id="map_a" class="mash-image">
<%= f.label 'A' %><br />
<%= f.hidden_field :map_a, :value => @map_a.id %>
<image src="<%= url_for @map_a %>.png" />
</div>
<div id="map_b" class="mash-image">
<%= f.label 'B' %><br />
<%= f.hidden_field :map_b, :value => @map_b.id %>
<image src="<%= url_for @map_b %>.png" />
</div>
<p>
<div id="map_a">
<%= f.label :map_a %><br />
<image src="<%= url_for @map_a %>.png" />
</div>
<div id="map_b">
<%= f.label :map_b %><br />
<image src="<%= url_for @map_b %>.png" />
</div>
<%= f.select :winner, [['A', @map_a.id], ['B', @map_b.id]] %>
</p>
<p>
<%= f.label :winner %><br />
<%= f.text_field :winner %>
</p>
<p>
<%= f.submit 'Create' %>
<%= f.submit 'Mash' %>
</p>
<% end %>