ruby - Rails execute script on server on Dojo Button click -
i've ruby script part of rails application used copy files directory inside server. using dojo front-end. i've dojo widget displaying button fine. want script executed when click dojo button.
wigdet extract:
<input type="button" data-dojo-type="dijit.form.button" dojoattachevent="_onclick:copyfiles" label="copy files"></input>
javascript function part of widget:
copyfiles: function() { window.location = '/files/copy_files' }
in routes have:
resources :files :copy_files
and in files_controller have:
def copy_files fc = filescopier.new source = '/home/myname/sourcefiles' dest = '/home/myname/backup' fc.copy_files(source,dest) end
but when clicked button nothing happens. i've tried running code inside view nothing happens.
i've resolved it. have change routes file per below:
put :copy_files, :on => :collection
and if put on show method inside controller work.
Comments
Post a Comment