Skip to content

Commit

Permalink
update contact email
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Mar 12, 2024
1 parent e3815ba commit d977e59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ module ApplicationHelper
def time_ago(time)
time_ago_in_words(time, scope: "datetime.distance_in_words.short")
end

def contact_email
Settings.instance.contact_email
end
end
2 changes: 1 addition & 1 deletion app/views/includes/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= link_to t('.home'), root_path %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.contact'), "mailto:[email protected]" %>
<%= link_to t('.contact'), "mailto:#{contact_email}" %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.stories'), stories_path %>
Expand Down
7 changes: 7 additions & 0 deletions config/initializers/settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Settings
include Singleton

def contact_email
ENV["DOMAIN_EMAIL_ADDRESS"]
end
end

0 comments on commit d977e59

Please sign in to comment.