Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
app/views/posts/show.html.erb: <%= my_new_post_path(:foo => 1) %> config/routes.rb: ActionController::Routing::Routes.draw do |map| map.my_new_post "new", :controller => "posts", :action => "show", :path_prefix => "/a/:a/:b" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end test/functional/posts_controller_test.rb: equire File.dirname(__FILE__) + '/../test_helper' require 'posts_controller' class PostsControllerTest < ActionController::TestCase def test_show get :show, :a => 1, :b => 2 end end $ ruby test/functional/posts_controller_test.rb Loaded suite test/functional/posts_controller_test Started E Finished in 0.051626 seconds. 1) Error: test_show(PostsControllerTest): ActionView::TemplateError: my_new_post_url failed to generate from {:controller=>"posts", :action=>"show", :foo=>1, :path_prefix=>"/a/:a/:b"}, expected: {:controller=>"posts", :action=>"show", :path_prefix=>"/a/:a/:b"}, diff: {:foo=>1} On line #1 of posts/show.html.erb 1: <%= my_new_post_path(:foo => 1) %>
This paste will be private.
From the Design Piracy series on my blog: