app/controllers/presentations_controller.rb in chili_presentations-0.1.3 vs app/controllers/presentations_controller.rb in chili_presentations-0.2.0
- old
+ new
@@ -5,10 +5,13 @@
def index
@presentations = @project.presentations
end
+ def instructions
+ end
+
def new
@versions = @project.versions.open
end
def create
@@ -56,10 +59,16 @@
end
redirect_to project_presentations_path(@project)
end
+ def download
+ send_data presentation.contents.path,
+ :filename => presentation.contents_file_name,
+ :type => presentation.contents.content_type
+ end
+
private
def presentation_params
params[:presentation].merge({:user_id => User.current.id})
end
@@ -69,9 +78,12 @@
def requested_content_type
case presentation.x_accel_redirect_path_to(params[:static_asset_path])
when /\.css$/ then "text/css"
when /\.js$/ then "text/javascript"
+ when /\.png$/ then "image/png"
+ when /\.gif$/ then "image/gif"
+ when /\.(jpeg|jpg)$/ then "image/jpeg"
else "text/html"
end
end
end