8000 Merge branch 'master' into custom_html_for_date_range_input · activeadmin/activeadmin@29a9b7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 29a9b7d

Browse files
authored
Merge branch 'master' into custom_html_for_date_range_input
2 parents eecc6f8 + 8ecfc77 commit 29a9b7d

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* Use filter label when condition has a predicate. [#5886] by [@ko-lem]
88
* Fix error when routing with array containing symbol. [#5870] by [@jwesorick]
9+
* Fix error when there is a model named `Tag` and `meta_tags` have been configured. [#5893] by [@micred], [@FabioRos] and [@deivid-rodriguez]
910
* Allow specifying custom input_html for DateRangeInput [#5867] by [@mirelon]
1011

1112
### Removals
@@ -529,6 +530,7 @@ Please check [0-6-stable] for previous changes.
529530
[#5877]: https://github.com/activeadmin/activeadmin/pull/5877
530531
[#5886]: https://github.com/activeadmin/activeadmin/pull/5886
531532
[#5870]: https://github.com/activeadmin/activeadmin/pull/5870
533+
[#5893]: https://github.com/activeadmin/activeadmin/pull/5893
532534
[#5867]: https://github.com/activeadmin/activeadmin/pull/5867
533535

534536
[@5t111111]: https://github.com/5t111111
@@ -555,6 +557,7 @@ Please check [0-6-stable] for previous changes.
555557
[@drn]: https://github.com/drn
556558
[@eikes]: https://github.com/eikes
557559
[@f1sherman]: https://github.com/f1sherman
560+
[@FabioRos]: https://github.com/FabioRos
558561
[@faucct]: https://github.com/faucct
559562
[@Fivell]: https://github.com/Fivell
560563
[@glebtv]: https://github.com/glebtv
@@ -580,6 +583,7 @@ Please check [0-6-stable] for previous changes.
580583
[@markstory]: https://github.com/markstory
581584
[@mauriciopasquier]: https://github.com/mauriciopasquier
582585
[@mconiglio]: https://github.com/mconiglio
586+
[@micred]: https://github.com/micred
583587
[@mirelon]: https://github.com/mirelon
584588
[@ndbroadbent]: https://github.com/ndbroadbent
585589
[@Nguyenanh]: https://github.com/Nguyenanh

features/meta_tags.feature

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,30 @@ Feature: Meta Tag
22

33
Add custom meta tags to head of pages.
44

5-
Background:
5+
Scenario: Logged out views include custom meta tags
66
Given a configuration of:
77
"""
8-
ActiveAdmin.register Post
9-
ActiveAdmin.application.meta_tags = { author: 'My Company' }
108
ActiveAdmin.application.meta_tags_for_logged_out_pages = { robots: 'noindex' }
119
"""
12-
13-
Scenario: Logged out views include custom meta tags
14-
Given I am logged out
10+
And I am logged out
1511
When I am on the login page
1612
Then the site should contain a meta tag with name "robots" and content "noindex"
1713

1814
Scenario: Logged in views include custom meta tags
19-
Given I am logged in
15+
Given a configuration of:
16+
"""
17+
ActiveAdmin.register Post
18+
ActiveAdmin.application.meta_tags = { author: 'My Company' }
19+
"""
20+
And I am logged in
2021
When I am on the dashboard
2122
Then the site should contain a meta tag with name "author" and content "My Company"
23+
24+
Scenario: Meta tags are not confused with a Tag model
25+
Given a show configuration of:
26+
"""
27+
ActiveAdmin.register Tag
28+
ActiveAdmin.application.meta_tags = { author: 'My Company' }
29+
"""
30+
Then I should not see "#<Tag:0x"
31+
And the site should contain a meta tag with name "author" and content "My Company"

lib/active_admin/views/pages/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def build_active_admin_head
3333
end
3434

3535
active_admin_namespace.meta_tags.each do |name, content|
36-
text_node(tag(:meta, name: name, content: content))
36+
text_node(meta(name: name, content: content))
3737
end
3838

3939
active_admin_application.javascripts.each do |path|
32B4

0 commit comments

Comments
 (0)
0