From ba1f62ed1369cf20567bb09ab4210ea391e6dfe8 Mon Sep 17 00:00:00 2001 From: James Smith Date: Fri, 2 May 2025 10:31:39 +0100 Subject: [PATCH] add websub concern to models --- app/models/model.rb | 1 + app/views/models/index.html.erb | 4 ++++ app/views/models/show.html.erb | 1 + 3 files changed, 6 insertions(+) diff --git a/app/models/model.rb b/app/models/model.rb index afdfb6fa3..730c011aa 100644 --- a/app/models/model.rb +++ b/app/models/model.rb @@ -15,6 +15,7 @@ class Model < ApplicationRecord include FaspClient::DataSharing::Lifecycle include Likeable include Relatable + include WebSubbable broadcasts_refreshes diff --git a/app/views/models/index.html.erb b/app/views/models/index.html.erb index b96ae3751..3d77404b6 100644 --- a/app/views/models/index.html.erb +++ b/app/views/models/index.html.erb @@ -2,4 +2,8 @@ <%= PageTitle title: Model.model_name.human(count: 100), heading: false %> <% end %> +<% content_for :head do %> + <%= web_sub_tags collection: true %> +<% end %> + <%= render "list" %> diff --git a/app/views/models/show.html.erb b/app/views/models/show.html.erb index 8e46667f7..a9d6f6a77 100644 --- a/app/views/models/show.html.erb +++ b/app/views/models/show.html.erb @@ -7,6 +7,7 @@ <%- if @model.entrypoint %> <%= tag.link rel: "alternate", as: "spatial-entrypoint", type: @model.entrypoint.mime_type, href: model_model_file_raw_url(@model, @model.entrypoint.filename, anchor: @model.entrypoint_fragment) %> <%- end %> + <%= web_sub_tags %> <% end %>