Permalink
Browse files

basic play functionality

  • Loading branch information...
1 parent 4c422b3 commit ef49afbadb7e49ab7baf590e22e45ec5d65ade12 @KentonWhite committed Jun 21, 2010
@@ -8,6 +8,8 @@ def index
def show
@maze = current_user.mazes.find(params[:id])
+ @node = @maze.nodes.first
+ redirect_to maze_node_url(@maze, @node)
end
def new
@@ -18,7 +20,7 @@ def create
@maze = current_user.mazes.new(params[:maze])
if @maze.save
flash[:notice] = "Successfully created maze."
- redirect_to new_maze_node_path(@maze)
+ redirect_to new_maze_node_url(@maze)
else
render :action => 'new'
end
@@ -2,6 +2,6 @@
<% @links.each do |link| %>
<p>
<%= link_to link.text, maze_node_path(@maze, link.to_node_id) %>
- <%= link_to 'Edit', edit_maze_node_link_path(@maze, @node, link) %>
+ <%= link_to 'Edit', edit_maze_node_link_path(@maze, @node, link) if edit %>
</p>
<% end %>
@@ -3,7 +3,7 @@
<%= render 'form' %>
<p>
-<%= render :partial => 'show_links' %>
+<%= render :partial => 'show_links', :locals => {:edit => true} %>
</p>
<p>
@@ -9,5 +9,7 @@
<%= @node.content %>
</p>
<p>
-<%= render :partial => 'show_links' %>
+<%= render :partial => 'show_links', :locals => {:edit => nil} %>
</p>
+
+<p><%= link_to 'Quit', mazes_path %></p>

0 comments on commit ef49afb

Please sign in to comment.