Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top