File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
lib/active_admin/resource_controller Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ Feature: Format as CSV
18
18
Scenario : Default with alias
19
19
Given a configuration of:
20
20
"""
21
- ActiveAdmin.register Post, :as => "Article "
21
+ ActiveAdmin.register Post, :as => "MyArticle "
22
22
"""
23
- When I am on the index page for articles
23
+ When I am on the index page for my_articles
24
24
And I follow "CSV"
25
- And I should download a CSV file for "articles" containing:
25
+ And I should download a CSV file for "my- articles" containing:
26
26
| Id | Title | Body | Published At | Created At | Updated At |
27
27
28
28
Scenario : With CSV format customization
Original file line number Diff line number Diff line change @@ -71,10 +71,9 @@ def active_admin_template(template)
71
71
end
72
72
73
73
# Returns a filename for the csv file using the collection_name
74
- # and current date such as 'articles-2011-06-24.csv'.
74
+ # and current date such as 'my- articles-2011-06-24.csv'.
75
75
def csv_filename
76
- collection_name = collection_path . split ( '/' ) . last
77
- "#{ collection_name } -#{ Time . now . strftime ( "%Y-%m-%d" ) } .csv"
76
+ "#{ resource_collection_name . to_s . gsub ( '_' , '-' ) } -#{ Time . now . strftime ( "%Y-%m-%d" ) } .csv"
78
77
end
79
78
end
80
79
end
You can’t perform that action at this time.
0 commit comments