Permalink
Browse files

add web文件下载

  • Loading branch information...
1 parent e76dfc8 commit 2fa58081ab251c1cc3a03716e67ca96a7afba14a @ben7th ben7th committed Jul 11, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 app/controllers/media_resources_controller.rb
@@ -9,15 +9,16 @@ def index
def file
resource_path = URI.decode(request.fullpath).sub('/file', '')
- @current_resource = MediaResource.get(current_user, resource_path)
+ current_resource = MediaResource.get(current_user, resource_path)
- if @current_resource.is_dir?
- @media_resources = @current_resource.media_resources.web_order
+ if current_resource.is_dir?
+ @current_dir = current_resource
+ @media_resources = @current_dir.media_resources.web_order
return render :action => 'index'
end
if @current_resource.is_file?
- return send_file @current_resource.attach.path
+ return send_file current_resource.attach.path
end
end

0 comments on commit 2fa5808

Please sign in to comment.