Helps
Getting
TemplateError
can be frustrating in Rails as it tends to swallow the exception that caused it within your
template. A workaround is to wrap your template with
begin rescue end
temporarily for debugging.
Interestings
“Markdown autolinks”
JPB informed us of the existence of autolinking in Markdown, like so
<http://pivotallabs.com>
renders
<a href="http://pivotallabs.com">http://pivotallabs.com</a>
resulting in http://pivotallabs.com
“Riding dirty”
This code might not work like you expect:
obj.content.gsub!(/foo/, 'bar')
it does not set the dirty bit, so
obj.content_changed?
will return
false
.
A workaround is to police yourself and use
obj.content_will_change
before, well, changing the
content
without using the setter on
obj
.