Skip to content

Commit

Permalink
Journal: Save Entry#summary when Writing Entries
Browse files Browse the repository at this point in the history
- zinc-collective#2
- zinc-collective#10

And just like that, there's a `Summary` field on the
`Journal::Entry#new` page!
  • Loading branch information
zspencer committed Jan 29, 2024
1 parent 507fe96 commit f6b16aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/furniture/journal/entries/_form.html.erb
Original file line number Diff line number Diff line change
@@ -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} %>

Expand Down
2 changes: 1 addition & 1 deletion app/furniture/journal/entry_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6b16aa

Please sign in to comment.