Permalink
Browse files

Show nodes for maze

  • Loading branch information...
1 parent 896c3b7 commit a5be1bd558af9cd4439cefcfc6f0dfbc60ac8ab3 @KentonWhite committed May 24, 2010
Showing with 11 additions and 0 deletions.
  1. +1 −0 app/controllers/mazes_controller.rb
  2. +10 −0 app/views/mazes/show.html.erb
View
1 app/controllers/mazes_controller.rb
@@ -8,6 +8,7 @@ def index
def show
@maze = current_user.mazes.find(params[:id])
+ @nodes = @maze.nodes.all
end
def new
View
10 app/views/mazes/show.html.erb
@@ -4,6 +4,16 @@
<strong>Title:</strong>
<%= @maze.title %>
</p>
+<p>
+ <strong>Nodes:</strong>
+ <% @nodes.each do |node| %>
+ <p>
+ <%= node.title %>
+ <%= link_to "Show", maze_node_path(@maze, node.id)%>
+ </p>
+ <% end %>
+
+</p>
<p>
<%= link_to "Edit", edit_maze_path(@maze) %> |

0 comments on commit a5be1bd

Please sign in to comment.