Actually mashing maps now, but not handling form post-back or making it pretty

This commit is contained in:
Dan Buch
2012-03-07 09:32:33 -05:00
parent dd73309ed1
commit b1e17869b1
22 changed files with 447 additions and 42 deletions

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Maps: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
</head>
<body>
<p style="color: green"><%= flash[:notice] %></p>
<%= yield %>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<h1>Editing map</h1>
<% form_for(@map) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @map %> |
<%= link_to 'Back', maps_path %>

View File

@@ -0,0 +1,20 @@
<h1>Listing maps</h1>
<table>
<tr>
<th>Name</th>
</tr>
<% @maps.each do |map| %>
<tr>
<td><%=h map.name %></td>
<td><%= link_to 'Show', map %></td>
<td><%= link_to 'Edit', edit_map_path(map) %></td>
<td><%= link_to 'Destroy', map, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New map', new_map_path %>

View File

@@ -0,0 +1,15 @@
<h1>New map</h1>
<% form_for(@map) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', maps_path %>

View File

@@ -0,0 +1,8 @@
<p>
<b>Name:</b>
<%=h @map.name %>
</p>
<%= link_to 'Edit', edit_map_path(@map) %> |
<%= link_to 'Back', maps_path %>

View File

@@ -4,16 +4,14 @@
<%= f.error_messages %>
<p>
<%= f.label :requester %><br />
<%= f.text_field :requester %>
</p>
<p>
<%= f.label :map_a %><br />
<%= f.text_field :map_a %>
</p>
<p>
<%= f.label :map_b %><br />
<%= f.text_field :map_b %>
<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>
</p>
<p>
<%= f.label :winner %><br />
@@ -24,4 +22,4 @@
</p>
<% end %>
<%= link_to 'Back', mashes_path %>
<%= link_to 'Back', mashes_path %>