Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow customization of application name in the generated title #13

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/plutonium/core/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module Controller
end

helper Plutonium::Helpers
helper_method :make_page_title, :resource_url_for, :resource_url_args_for, :root_path
helper_method :make_page_title, :resource_url_for,
:resource_url_args_for, :root_path, :app_name

append_view_path File.expand_path("app/views", Plutonium.root)
layout -> { turbo_frame_request? ? false : "resource" }
Expand All @@ -30,7 +31,11 @@ def set_page_title(page_title)
end

def make_page_title(title)
[title.presence, helpers.application_name].compact.join(" | ")
[title.presence, app_name].compact.join(" | ")
end

def app_name
helpers.application_name
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/plutonium/ui/form/interaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize_attributes
end

def submit_button(*, **)
super(*, **) do
super do
object.label
end
end
Expand Down
Loading