As I am using Ruby on Rails to build an application, which only runs locally, I am lost in the woods (a nuby without a compass). I have a simple MVC application and my view is missing one thing I could really use. I want to select a local file just to retrieve it’s filename. I know it’s relatively easy to use the form tag helpers for uploading:
<%= file_field 'upload', 'datafile' %></p>
I wonder how I could get the filename from the selected file, without uploading the file.
You could use jquery. Just do something like
if you have to pass the name to your application you could just use jquery post to your controller. Your controller should be able to understand the format js (hint: respond_to).