Rails 4.2.5 and ruby 2.3.3p222
I am using Paperclip to upload files, if I upload pdf's the display works fine but I cant find a way to display word files correctly in the browser.
Model:
has_attached_file :document
validates_attachment :document, :content_type => { :content_type => %w(application/pdf application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document) }
In my form:
<%= f.input :document, as: :file %>
In my show:
<iframe src="<%= @article.document.url %>" style="height:800px;width:100%"></iframe>
Again, if its a pdf it shows perfectly, although if its a word file it just downloads the file instantly as soon as I load the page.
I think its the that I am using in the Show page but cant find any solution when searching on google. Anyone tried to do this or has any suggestion?
Thanks in advance.