Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clean up naming

  • Loading branch information...
commit c2887e4aeddbc4669f9c7ff7a11ca672b6fb3e65 1 parent 6deeb27
@jackdempsey authored
View
4 app/models/documents/document.rb
@@ -9,6 +9,10 @@ class Document < ActiveRecord::Base
mount_uploader :file, BasicDocumentUploader
+ def to_s
+ File.basename(file.to_s)
+ end
+
def as_json(options=nil)
{
name: read_attribute(:file),
View
2  app/views/documents/documents/index.html.haml
@@ -38,7 +38,7 @@
%ul.list.list_document
- @documents.each do |document|
%li
- = link_to document.file.url, document
+ = link_to document, document
- else
No documents currently.
Please sign in to comment.
Something went wrong with that request. Please try again.