ryanckulp / white_bnb

White-labeled Airbnb
MIT License
12 stars 0 forks source link

Metamagic Error on Root Page #21

Open niklasbabel opened 1 month ago

niklasbabel commented 1 month ago

Metamagic Error on Root Page

Description

when starting the server with bin/dev, the root page (http://127.0.0.1:3000/) failed to load due to a Metamagic error

Error Message

RuntimeError in Pages#home
Showing /Users/niklasbabel/Documents/code/white_bnb/app/views/layouts/application.html.erb where line #4 raised:
Metamagic site not set. Please use `metamagic site: 'My Site'` to set it.

Cause

error occurred because Rails.application.credentials.company_name was not set or returning nil

Solution implemented

added a fallback value in application.html.erb:

<%= metamagic site: Rails.application.credentials.company_name || 'white_bnb', title: [:site, :title], separator: " | " %>

Questions