Links
Twitter
Flickr
« I like the new Macbook | Main | Understanding this credit crunch thing »
Friday
Oct102008

Add ERB to your ActionMailer fixtures

Easy:


def read_fixture(action)
template = ERB.new(
IO.readlines(
"#{FIXTURES_PATH}/sms_registrations_mailer/#{action}"
).join
)
template.result(binding)
end


Now you can <%= %> in your fixture to your heart's content.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>