Skip to content
Snippets Groups Projects
Commit 8475cb1f authored by Arnaud Levy's avatar Arnaud Levy
Browse files

basic

parent ffec0412
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web
def post_params
params.require(:communication_website_post)
.permit(
:university_id, :website_id, :title, :description, :text, :text_new,
:university_id, :website_id, :title, :description, :text, :text_wysiwyg,
:published, :published_at, :featured_image, :featured_image_delete,
:featured_image_infos, :featured_image_alt, :slug, :pinned,
:author_id, category_ids: []
......
......@@ -66,6 +66,16 @@ class Communication::Website::Post < ApplicationRecord
scope :ordered, -> { order(published_at: :desc, created_at: :desc) }
scope :recent, -> { order(published_at: :desc).limit(5) }
def text_summernote
# TODO hydrate action-text-attachment
self.text
end
def text_summernote=(value)
# TODO dehydrate action-text-attachment
self.text = value
end
def path
# used in menu_item#static_target
"/#{published_at.strftime "%Y/%m/%d"}/#{slug}"
......
......@@ -9,7 +9,7 @@
<%= f.input :title %>
<%= f.input :description %>
<%= f.input :text, as: :rich_text_area %>
<%= f.input :text_new, as: :summernote %>
<%= f.input :text_summernote, as: :summernote %>
</div>
</div>
<div class="card flex-fill w-100">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment