Skip to content

Instantly share code, notes, and snippets.

<tr class="marked">
<td colspan="5"><pre><a name="line6"></a>6 def toc_for(article)</pre></td>
</tr>
<tr class="uncovered">
<td colspan="5"><pre><a name="line7"></a>7 '<ul id="toc_links">' + article.toc.collect{ |h5|</pre></td>
</tr>
<tr class="uncovered">
<td colspan="5"><pre><a name="line8"></a>8 '<li>' + link_to(h5[:title], url_for_article(article) + '?article_page=' + h5[:page].to_s + '#' + h5[:id]) + '</li>'</pre></td>
</tr>
<tr class="uncovered">
@vrinek
vrinek / avatar.rb
Created June 25, 2009 12:02
attachment_fu custom error messages
class Avatar < ActiveRecord::Base
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => 'c128x128',
:thumbnails => {:tiny => 'c24x24', :small => "c48x48"}
validates_as_attachment
after_validation :greeklize_attachment_errors