I currently have a Ruby on Rails project that has CarrierWave running on it. The project allows uploading of text files.
I’m stumped, though.
How can I open these files and put their text content into an HTML textarea element?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The solution I was looking for was very simple. I used jQuery’s ajax method “get()”. This method accepts a URL to a file (text file in this case) and then does some action. So, for a textarea, this action would include setting the textarea’s val to the data the get() method retrieves.