mirror of
https://github.com/edcommonwealth/ecp.org.git
synced 2026-03-07 21:48:13 -08:00
Fix broken file downloads
This commit is contained in:
parent
a173740ded
commit
f2089c2eeb
6 changed files with 9 additions and 3 deletions
|
|
@ -2,4 +2,9 @@ class ResearchController < ApplicationController
|
|||
def index
|
||||
|
||||
end
|
||||
|
||||
|
||||
def download_pdf
|
||||
send_file "#{Rails.root}/public/docs/#{params[:path]}.pdf", type: "application/pdf", x_sendfile: true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@
|
|||
<div class="container px-5 my-5">
|
||||
<div class="row gx-5 justify-content-center">
|
||||
<div class="grid-container download-container">
|
||||
<%= link_to("Test Anxiety", download: asset_path("docs/test_anxiety_and_poor_sleep_2021.pdf"), target: "_blank") do %>
|
||||
<%= link_to(research_download_pdf_path(path: "test_anxiety_and_poor_sleep")) do %>
|
||||
<%= image_tag "research/test_anxiety_and_sleep.png", class: "file-download" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid-container download-container">
|
||||
<%= link_to("Psychological toll of high statkes testing", download: asset_path("docs/psychological_toll_of_high_stakes_testing_2022.pdf"), target: "_blank") do %>
|
||||
<%= link_to(research_download_pdf_path(path: "psychological_toll_of_high_stakes_testing")) do %>
|
||||
<%= image_tag "research/psychological_toll_of_high_stakes_testing.png", class: "file-download" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid-container download-container">
|
||||
<%= link_to("Test Anxiety", download: asset_path("docs/testing_stress_and_performance.pdf"), target: "_blank") do %>
|
||||
<%= link_to( research_download_pdf_path(path: "testing_stress_and_performance")) do %>
|
||||
<%= image_tag "research/testing_stress.png", class: "file-download" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Rails.application.routes.draw do
|
|||
resources :qpa, only: :index
|
||||
resources :resource, only: :index
|
||||
resources :research, only: :index
|
||||
get 'research/download_pdf', to: "research#download_pdf"
|
||||
resources :work_with_ecp, only: :index
|
||||
resources :construction, only: :index
|
||||
resources :district_leader, only: :index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue