How to show .Doc files after uploading

Hello guys,
i have created a simple app using devise and paperclip gem.
I created my model using devise and i created a seperate controller to
show what user has uploaded and generated the view file for it too.
i have uploaded .Doc file and in the browser i’m getting my table as
Name, Email and Document as per my show file, But Under Document i am
getting the url for the doc i uploaded
How can i view the doc file i uploaded and generate a download link of
that.

On 2 April 2015 at 08:21, Edward M. [email protected] wrote:

Attachments:
http://www.ruby-forum.com/attachment/10648/list_controller.jpg
http://www.ruby-forum.com/attachment/10649/sessions_controller_Of_Devise.jpg
http://www.ruby-forum.com/attachment/10650/show_File.jpg
http://www.ruby-forum.com/attachment/10651/User_Model.jpg

Please don’t use images to show code, include relevant code here,
provided it is only a few lines, or put it somewhere like pastebin to
make it available.

Whether a file is downloaded or opened in the browser when the user
clicks on a link to it depends on whether the browser has the right
plugins or not.
What happens if you click on the link to the document?

Colin

Colin L. wrote in post #1171404:

Please don’t use images to show code, include relevant code here,
provided it is only a few lines, or put it somewhere like pastebin to
make it available.

Whether a file is downloaded or opened in the browser when the user
clicks on a link to it depends on whether the browser has the right
plugins or not.
What happens if you click on the link to the document?

Colin

I don’t know how to unable download links for a uploaded file(unable to
find on google) and i don’t have any link to be clicked on i.e is what
i’m asking.

On 2 April 2015 at 10:24, Edward M. [email protected] wrote:

Colin

I don’t know how to unable download links for a uploaded file(unable to
find on google) and i don’t have any link to be clicked on i.e is what
i’m asking.

I believe you asked this question once before. What do you think in
your code the td with image_tag user.avatar.url does? (see now why not
to use a jpg, I have had to go and look at the image and re-type it
rather than copying). Look at the html in the browser and see what it
is.

Colin

Colin L. wrote in post #1171411:

I believe you asked this question once before. What do you think in
your code the td with image_tag user.avatar.url does? (see now why not
to use a jpg, I have had to go and look at the image and re-type it
rather than copying). Look at the html in the browser and see what it
is.

Colin

Yea i did but unable to find anything Googling so trying my self.
yea i know image_tag user.avatar.url gives me the url of file uploaded.
but can you tell me or point me towards some direction in rails 4 how
would i generate links for my uploaded files.

and one more thing when i upload images whether jpg or png it gives e
paperclip not identified error and i have dont everything uninstalling
and installing again imagemagick and also put
Paperclip.options[:command_path] = “/usr/local/bin/”
in development.rb
but still error

On 2 April 2015 at 11:14, Edward M. [email protected] wrote:

yea i know image_tag user.avatar.url gives me the url of file uploaded.
but can you tell me or point me towards some direction in rails 4 how
would i generate links for my uploaded files.

I told you that when you asked before. Use link_to rather than
image_tag so you will make a link to the url not an image of the
document.

and one more thing when i upload images whether jpg or png it gives e
paperclip not identified error and i have dont everything uninstalling
and installing again imagemagick and also put
Paperclip.options[:command_path] = “/usr/local/bin/”
in development.rb
but still error

Start a new thread for that one. It is always best to ask one
question per thread or everything gets confused. First try googling
for the exact error message you get. If that does not help, or if you
have done it already then copy/paste the full error message in the new
thread and if it points to your code then also post that section of
code (just the lines leading up to the error).

Colin