I'm hitting this bug in my application, where ajax in mobile safari stops working after receiving a response with Content-Disposition:attachment
I want to keep sending disposition:attachment to desktop browsers and to non-iOS mobile devices, while switching to disposition:inline on iOS. I need to do this in a few different controller actions.
Is there an elegant way of doing this beyond putting these types of blocks all over the place?
if request.env['HTTP_USER_AGENT'] =~ /iPad/
disposition = :inline
else
disposition = :attachment
end