문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top