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

Recommend using target="_blank" instead of target="blank" (incorrect) #8278

Merged
merged 1 commit into from
Apr 5, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/1-general-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ ActiveAdmin.setup do |config|
config.namespace :admin do |admin|
admin.build_menu :utility_navigation do |menu|
menu.add label: "ActiveAdmin.info", url: "https://www.activeadmin.info",
html_options: { target: :blank }
html_options: { target: "_blank" }
admin.add_current_user_to_menu menu
admin.add_logout_button_to_menu menu
end
Expand Down
2 changes: 1 addition & 1 deletion docs/2-resource-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ config.namespace :admin do |admin|
menu.add label: "Sites" do |sites|
sites.add label: "Google",
url: "https://google.com",
html_options: { target: :blank }
html_options: { target: "_blank" }

sites.add label: "Facebook",
url: "https://facebook.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ActiveAdmin.setup do |config|
#
# config.namespace :admin do |admin|
# admin.build_menu :default do |menu|
# menu.add label: "My Great Website", url: "https://mygreatwebsite.example.com", html_options: { target: :blank }
# menu.add label: "My Great Website", url: "https://mygreatwebsite.example.com", html_options: { target: "_blank" }
# end
# end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/menu_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module ActiveAdmin
end

it "should accept an options hash for link_to" do
item = MenuItem.new html_options: { target: :blank }
expect(item.html_options).to include(target: :blank)
item = MenuItem.new html_options: { target: "_blank" }
expect(item.html_options).to include(target: "_blank")
end

context "with no items" do
Expand Down