Skip to content

Commit

Permalink
Fix zeitwerk error
Browse files Browse the repository at this point in the history
  • Loading branch information
karinevieira committed Feb 20, 2025
1 parent 47eb946 commit f1d2d98
Show file tree
Hide file tree
Showing 10 changed files with 380 additions and 360 deletions.
2 changes: 1 addition & 1 deletion app/controllers/docs_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class DocsController < ApplicationController
layout -> { DocsLayout }
layout -> { Views::Layouts::DocsLayout }

# GETTING STARTED
def introduction
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class ErrorsController < ApplicationController
layout -> { ErrorsLayout }
layout -> { Views::Layouts::ErrorsLayout }

def not_found
render Views::Errors::NotFoundView.new, status: :not_found
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class PagesController < ApplicationController
layout -> { PagesLayout }
layout -> { Views::Layouts::PagesLayout }

def home
render Views::Pages::HomeView.new
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/themes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class ThemesController < ApplicationController
layout -> { ApplicationLayout }
layout -> { Views::Layouts::ApplicationLayout }

# GET /themes/:theme
def show
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ApplicationMailer < ActionMailer::Base
default from: email_address_with_name(ENV["MAILER_SENDER"], ENV["APP_NAME"]),
reply_to: ENV["MAILER_SENDER"]
layout -> { MailerLayout }
layout -> { Views::Layouts::MailerLayout }

def self.template_path
"mailers/#{name.underscore}"
Expand Down
24 changes: 14 additions & 10 deletions app/views/layouts/application_layout.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# frozen_string_literal: true

class ApplicationLayout < Views::Base
include Phlex::Rails::Layout
module Views
module Layouts
class ApplicationLayout < Views::Base
include Phlex::Rails::Layout

def view_template(&block)
doctype
def view_template(&block)
doctype

html do
render Shared::Head.new
html do
render Shared::Head.new

body do
render Shared::Navbar.new
main(&block)
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
body do
render Shared::Navbar.new
main(&block)
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
end
end
end
end
end
Expand Down
32 changes: 18 additions & 14 deletions app/views/layouts/docs_layout.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
# frozen_string_literal: true

class DocsLayout < Views::Base
include Phlex::Rails::Layout
module Views
module Layouts
class DocsLayout < Views::Base
include Phlex::Rails::Layout

def view_template(&block)
doctype
def view_template(&block)
doctype

html do
render Shared::Head.new
html do
render Shared::Head.new

body do
render Shared::Navbar.new
div(class: "flex-1") do
div(class: "border-b") do
div(class: "container px-4 flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10") do
render Shared::Sidebar.new
main(class: "relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]", &block)
body do
render Shared::Navbar.new
div(class: "flex-1") do
div(class: "border-b") do
div(class: "container px-4 flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10") do
render Shared::Sidebar.new
main(class: "relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]", &block)
end
end
end
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
end
end
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
end
end
end
Expand Down
30 changes: 17 additions & 13 deletions app/views/layouts/errors_layout.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# frozen_string_literal: true

class ErrorsLayout < Views::Base
include Phlex::Rails::Layout
module Views
module Layouts
class ErrorsLayout < Views::Base
include Phlex::Rails::Layout

def view_template(&block)
doctype
def view_template(&block)
doctype

html do
render Shared::Head.new
html do
render Shared::Head.new

body do
main(class: "relative flex flex-col items-center justify-center gap-y-6 h-screen w-screen overflow-y-scroll") do
render Shared::GridPattern.new
ThemeToggle(class: "hidden") # In order for dark mode to work, we need to render the theme toggle somewhere in the DOM
render Shared::Logo.new
div(class: "container w-full max-w-md", &block)
body do
main(class: "relative flex flex-col items-center justify-center gap-y-6 h-screen w-screen overflow-y-scroll") do
render Shared::GridPattern.new
ThemeToggle(class: "hidden") # In order for dark mode to work, we need to render the theme toggle somewhere in the DOM
render Shared::Logo.new
div(class: "container w-full max-w-md", &block)
end
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
end
end
render Shared::Flashes.new(notice: flash[:notice], alert: flash[:alert])
end
end
end
Expand Down
Loading

0 comments on commit f1d2d98

Please # to comment.