app/controllers/card_controller.rb in wagn-1.13.0.pre vs app/controllers/card_controller.rb in wagn-1.13.0.pre1
- old
+ new
@@ -225,29 +225,31 @@
end
def show view = nil, status = 200
+# ActiveSupport::Notifications.instrument('wagn', message: 'CardController#show') do
+
format = request.parameters[:format]
format = :file if params[:explicit_file] or !Card::Format.registered.member? format #unknown format
opts = ( params[:slot] || {} ).deep_symbolize_keys
view ||= params[:view]
formatter = card.format( :format=>format )
-
result = formatter.show view, opts
status = formatter.error_status || status
-
+
if format==:file && status==200
send_file *result
elsif status == 302
wagn_redirect result
else
args = { :text=>result, :status=>status }
args[:content_type] = 'text/text' if format == :file
render args
end
+# end
end
rescue_from Exception do |exception|
Rails.logger.info "exception = #{exception.class}: #{exception.message}"