moved gateway code here

This commit is contained in:
2022-11-28 23:58:17 +02:00
parent 596d3eb476
commit d063f58636
66 changed files with 944 additions and 0 deletions

View File

@ -0,0 +1,6 @@
module Merged
module ImageHelper
end
end

View File

@ -0,0 +1,2 @@
module Merged::PagesHelper
end

View File

@ -0,0 +1,10 @@
module Merged::SectionHelper
def section_form(options)
url = merge_page_section_url( @page.id , @section.id)
puts "URL #{url}"
form_tag( url , {method: :patch}) do
yield
end
end
end

View File

@ -0,0 +1,20 @@
module Merged
module ViewHelper
# section should be hash with at least 'template' key
def find_template(section)
"sections/" + section["template"]
end
def bg(section)
#{'background-image' => url('#{image_url('merge/' + section['image'])}')}
img = image_url "merge/house.jpg"
"background-image: url('#{img}');"
end
def image_for(section , classes)
image_tag("merge/#{section['image']}" , class: classes)
end
def has_button(section)
section['button']
end
end
end