
Untitled
By: a guest on
Apr 22nd, 2012 | syntax:
None | size: 0.49 KB | hits: 7 | expires: Never
# Sets content type based on the information from the device info
def set_content_type
self.content_type = :mobile if request.device['is.mobile'] == 1
end
# Fallback from the non-existing type template to html template
def _template_location(context, type, controller)
template = super
template = super(context, :mobile, controller) unless File.exists?(Merb.dir_for(:view) / "#{template}.erb")
Merb.logger.debug "Rendering template: #{template}"
template
end