add support for download files
This commit is contained in:
@@ -102,7 +102,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def preview_file_url
|
||||
if is_flash?
|
||||
if !is_image?
|
||||
return "/images/download-preview.png"
|
||||
end
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ class PostPresenter < Presenter
|
||||
|
||||
if @post.is_flash?
|
||||
template.render("posts/partials/show/flash", :post => @post)
|
||||
elsif !@post.is_image?
|
||||
template.render("posts/partials/show/download", :post => @post)
|
||||
elsif @post.is_image?
|
||||
template.render("posts/partials/show/image", :post => @post)
|
||||
end
|
||||
|
||||
1
app/views/posts/partials/show/_download.html.erb
Normal file
1
app/views/posts/partials/show/_download.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<p><%= link_to "Save this file (right click and save)", post.file_url %></p>
|
||||
Reference in New Issue
Block a user