Skip to content

Commit

Permalink
Merge pull request #24 from bmic-development/jjh-protocol-xlsx
Browse files Browse the repository at this point in the history
Truncate long filenames for Protocol export [#137891257]
  • Loading branch information
jleonardw9 committed Jan 19, 2017
2 parents 06149a4 + bc1ea77 commit 1977127
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/dashboard/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def show
render
}
format.xlsx {
@statuses_hidden = params[:statuses_hidden]
@statuses_hidden = params[:statuses_hidden] || %w(draft first_draft)
response.headers['Content-Disposition'] = "attachment; filename=\"(#{@protocol.id}) Consolidated Corporate Study Budget.xlsx\""
}
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/arm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def name_unique_to_protocol
end

def sanitized_name
#Sanitized for Excel
name.gsub(/\[|\]|\*|\/|\\|\?|\:/, ' ')
# Sanitized for Excel
name.gsub(/\[|\]|\*|\/|\\|\?|\:/, ' ').truncate(31)
end

def update_liv_subject_counts
Expand Down

0 comments on commit 1977127

Please sign in to comment.