Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Jenna Fox

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Substitute for the :spacer_template option to rail's "render" method

when working with the :collection option, it seems silly to have to have an entire file just for a spacer, which would probably just be something like "
" for most, so this is a great substitute for
<%= render :partial => "thing", :collection => @coll, :spacer_template => "filename_to_file_with_hr_inside_it" %>


New version with code embedded:
  <%= @coll.map { |item| render :partial => "thing", :locals => {:thing => item} }.join("
") %>
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed