Hello All,
while trying to implement the number of downloads on a particular
video I added a num_downloads column on my video table.
And I tried this below :
<%=link_to “Download”,
@video.public_filename,
:onClick=>“downloadVideo(’#{download_video_url(@video.id)}’);alert(‘csdc’);”
%>
downloadVideo is a js function that goes like this below :
function downloadVideo(url) {
new Ajax.Request(url,{
method:‘get’
}
)};
But the problem is that I’m having a 500 Http error, so … my
routes.rb now regarding the videos goes like this :
map.resources :videos,
:member => {
:download => :get,
:create_comment => :post,
:paged_comments => :get
}
I can’t figure out why the download action cannot be invoked; if u
have any idea regarding this issue please let me know.
Regards,
Joel