Extract methods in footer component
This way it'll be easier to change and refactor this code.
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
<p class="info">
|
<p class="info">
|
||||||
<%= sanitize(t("layouts.footer.description",
|
<%= sanitize(t("layouts.footer.description",
|
||||||
open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "_blank", rel: "nofollow"),
|
open_source: open_source_link,
|
||||||
consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "_blank", rel: "nofollow"))) %>
|
consul: repository_link)) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,16 @@ class Layout::FooterComponent < ApplicationComponent
|
|||||||
def footer_legal_content_block
|
def footer_legal_content_block
|
||||||
content_block("footer_legal")
|
content_block("footer_legal")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def open_source_link
|
||||||
|
link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "_blank",
|
||||||
|
rel: "nofollow")
|
||||||
|
end
|
||||||
|
|
||||||
|
def repository_link
|
||||||
|
link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "_blank",
|
||||||
|
rel: "nofollow")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user