helper for forms, done fighting rails on namespacing

This commit is contained in:
2022-11-27 21:03:49 +02:00
parent 6bb0b35d3f
commit 4814f53d1e
7 changed files with 23 additions and 7 deletions

View File

@ -1,6 +1,6 @@
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold= key.upcase
= form_tag( {url: cms_page_section_path( @page.name, @section.id), class: "mx-auto.mt-8.mb-0.max-w.space-y-4"} , {method: :patch }) do
= section_form( class: "mx-auto mt-8 mb-0 max-w space-y-4") do
= text_field_tag( :header , @section.content["header"], class: "w-full.rounded-lg.border-gray-200.p-4.pr-12.text-sm.shadow-sm")
%button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"}
Update

View File

@ -1,5 +1,8 @@
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold= key.upcase
%button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white
Update
.relative.block.border.border-gray-100
-if value
= image_tag "cms/" + value

View File

@ -1,4 +1,7 @@
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold= key.upcase
.relative.block.border.border-gray-100
%p= value
= section_form( class: "mx-auto mt-8 mb-0 max-w space-y-4") do
= text_area_tag( :text , @section.content["text"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")
%button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"}
Update