From 8040f7bb9eb25787efc2817bd360ad428525f799 Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:59:18 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20`Journal`:=20Save=20`Entry#summary`?= =?UTF-8?q?=20when=20Writing=20`Entries`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/zinc-collective/convene-journal/issues/2 - https://github.com/zinc-collective/convene-journal/issues/10 And just like that, there's a `Summary` field on the `Journal::Entry#new` page! --- app/furniture/journal/entries/_form.html.erb | 2 ++ app/furniture/journal/entry_policy.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/furniture/journal/entries/_form.html.erb b/app/furniture/journal/entries/_form.html.erb index 42186983f..8f5d33d03 100644 --- a/app/furniture/journal/entries/_form.html.erb +++ b/app/furniture/journal/entries/_form.html.erb @@ -1,5 +1,7 @@ <%= form_with model: entry.location, class: "flex flex-col grow" do |f| %> <%= render "text_field", { attribute: :headline, form: f} %> + <%= render "text_area", { attribute: :summary, form: f} %> + <%= render "text_area", { attribute: :body, form: f, field_classes: "grow", container_classes: "grow flex flex-col"} %> <%= render "datetime_field", { attribute: :published_at, form: f} %> diff --git a/app/furniture/journal/entry_policy.rb b/app/furniture/journal/entry_policy.rb index f54d4fb65..ebbb6bbe1 100644 --- a/app/furniture/journal/entry_policy.rb +++ b/app/furniture/journal/entry_policy.rb @@ -17,7 +17,7 @@ def update? end def permitted_attributes(_params) - %i[headline body published_at] + %i[headline summary body published_at] end class Scope < ApplicationScope