Files
timeoverflow/app/controllers/documents_controller.rb
Francisco José Perejón Barrios 6119ffe286 Upgrade to Bootstrap v5 (#780)
2025-03-22 16:30:47 +01:00

21 lines
457 B
Ruby

class DocumentsController < ApplicationController
def show
@document = find_document_or_missing
respond_to do |format|
format.html do
if params[:modal]
render partial: "show+modal", layout: false
end
end
end
end
private
def find_document_or_missing
Document.find params[:id]
rescue ActiveRecord::NotFound
Document.new(title: "Missing document", content: "Available very soon")
end
end