diff --git a/app/views/application/_object_preview.html.erb b/app/views/application/_object_preview.html.erb index 52d78337e..9ef73ad3a 100644 --- a/app/views/application/_object_preview.html.erb +++ b/app/views/application/_object_preview.html.erb @@ -1,7 +1,7 @@ <% if renderable?(file.extension) %>
" data-format="<%= file.extension %>" data-y-up="<%= file.y_up %>" diff --git a/app/views/model_files/show.html.erb b/app/views/model_files/show.html.erb index 13fd3b135..f081bae9f 100644 --- a/app/views/model_files/show.html.erb +++ b/app/views/model_files/show.html.erb @@ -66,7 +66,7 @@ <%= render partial: "problem", collection: @file.problems.visible(problem_settings) %> <%= card :secondary, t(".actions_heading") do %> - <%= link_to safe_join([icon("cloud-download", t("general.download")), t("general.download")], " "), model_model_file_path(@model, @file, @file.extension.to_sym, download: "true"), {class: "btn btn-secondary"} %> + <%= link_to safe_join([icon("cloud-download", t("general.download")), t("general.download")], " "), model_model_file_path(@model, @file, @file.extension&.to_sym, download: "true"), {class: "btn btn-secondary"} %> <% if policy(@file).edit? && ["stl", "obj"].include?(@file.extension) %> <%= link_to safe_join([icon("arrow-left-right", t(".convert")), t(".convert")], " "), model_model_files_path(@model, convert: {id: @file.to_param, to: "threemf"}), method: :post, class: "btn btn-warning" %> <% end %> diff --git a/app/views/models/_file.html.erb b/app/views/models/_file.html.erb index 7c5d74c5d..015a27e75 100644 --- a/app/views/models/_file.html.erb +++ b/app/views/models/_file.html.erb @@ -27,7 +27,7 @@ q0,5 5,5 h10 " /> - <%= file.extension.upcase %> + <%= file.extension&.upcase %> <% end %> <% end %> @@ -41,7 +41,7 @@
<%= link_to t(".open_button.text"), model_model_file_path(@model, file), {class: "btn btn-primary", "aria-label": translate(".open_button.label", name: file.name)} %> - <%= link_to icon("cloud-download", t("general.download")), model_model_file_path(@model, file, file.extension.to_sym, download: "true"), {class: "btn btn-outline-secondary"} %> + <%= link_to icon("cloud-download", t("general.download")), model_model_file_path(@model, file, file.extension&.to_sym, download: "true"), {class: "btn btn-outline-secondary"} %> <% if policy(@model).edit? %> <%= form_with model: @model, class: "d-inline" do |form| %> <%= form.hidden_field :preview_file_id, value: file.id %>