button helper

This commit is contained in:
2022-12-02 15:04:53 +02:00
parent f81922fe01
commit 9d125ace16
5 changed files with 59 additions and 48 deletions

View File

@ -1,4 +0,0 @@
module Merged
module ApplicationHelper
end
end

View File

@ -0,0 +1,26 @@
module Merged
module MergedHelper
def blue_button( text, url)
button( text , url , "bg-blue-500" )
end
def yellow_button( text, url)
button( text , url , "bg-yellow-500" )
end
def red_button( text, url)
button( text , url , "bg-red-500" )
end
def green_button( text, url)
button( text , url , "bg-green-500" )
end
def button(text , url , color)
claz = color + " ml-3 inline-block rounded-lg px-4 py-3 text-md font-medium text-white"
link_to(url) do
content_tag(:button , class: claz ) do
text
end
end
end
end
end