# Prepare the options hash for each format
# We need to delete anything relating to the other format here
# before we try to render the template.
[:html, :text].each do |fmt|
opts_hash[fmt] = opts.delete(fmt)
opts_hash[fmt] ||= actions[fmt] if actions && actions[fmt]
opts_hash[:template] = templates[fmt] if templates && templates[fmt]
end