Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# This is your Articles Controller (/app/controllers/article_controller.rb) class ArticlesController < ApplicationController def show # This would be accessed at www.mysite.org/articles/show/1 @article = Article.find params[:id] end end # This is /app/views/articles/show.rhtml <h2><%= @article.title %></h2> <p> <%= @article.body %> </p> <% if @article.has_comments? %> <ul> <%= render :partial => 'comment', :collection => comment.children %> </ul> <% end %> # This is /app/views/articles/_comment.rhtml <li> <%= comment.title %> <p> <%= comment.body %> </p> <% if comment.has_children? %> <ul> <%= render :partial => 'comment', :collection => comment.children %> </ul> <% end %> </li>
This paste will be private.
From the Design Piracy series on my blog: