Hi all,
In My controller I am trying to render vanilla JavaScript but am getting an unexpected result. This is the code
class UploadController < ApplicationController
def index
render :file => 'app\views\upload\uploadfile.rhtml'
end
def uploadFile
render :js => "alert('Hello Rails');"
post = DataFile.save(params[:upload])
end
end
Am expecting before executing post = DataFile.save(params[:upload]) I should see a alertbox but I am seeing a download box. What could be the problem?