activeadmin 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

Files changed (117) hide show
  1. data/.travis.yml +1 -1
  2. data/CHANGELOG.md +92 -1
  3. data/CONTRIBUTING.md +3 -3
  4. data/Gemfile +6 -5
  5. data/README.rdoc +6 -1
  6. data/Rakefile +2 -2
  7. data/app/assets/stylesheets/active_admin/_forms.css.scss +13 -2
  8. data/app/assets/stylesheets/active_admin/components/_comments.css.scss +1 -0
  9. data/app/assets/stylesheets/active_admin/components/_table_tools.css.scss +2 -1
  10. data/app/views/active_admin/resource/index.csv.erb +4 -1
  11. data/app/views/layouts/active_admin_logged_out.html.erb +3 -3
  12. data/docs/0-installation.md +0 -7
  13. data/docs/1-general-configuration.md +37 -0
  14. data/docs/11-decorators.md +48 -0
  15. data/docs/12-arbre-components.md +145 -0
  16. data/docs/2-resource-customization.md +23 -6
  17. data/docs/3-index-pages.md +5 -0
  18. data/docs/4-csv-format.md +11 -2
  19. data/docs/8-custom-actions.md +2 -2
  20. data/features/breadcrumb.feature +27 -0
  21. data/features/decorators.feature +41 -0
  22. data/features/i18n.feature +7 -0
  23. data/features/index/format_as_csv.feature +40 -3
  24. data/features/index/index_as_table.feature +6 -6
  25. data/features/step_definitions/format_steps.rb +6 -1
  26. data/lib/active_admin.rb +1 -1
  27. data/lib/active_admin/application.rb +15 -7
  28. data/lib/active_admin/comments/comment.rb +4 -2
  29. data/lib/active_admin/csv_builder.rb +2 -1
  30. data/lib/active_admin/devise.rb +1 -0
  31. data/lib/active_admin/dsl.rb +25 -0
  32. data/lib/active_admin/filters/dsl.rb +9 -0
  33. data/lib/active_admin/filters/forms.rb +2 -0
  34. data/lib/active_admin/filters/resource_extension.rb +32 -2
  35. data/lib/active_admin/form_builder.rb +29 -12
  36. data/lib/active_admin/inputs.rb +1 -0
  37. data/lib/active_admin/inputs/filter_boolean_input.rb +40 -0
  38. data/lib/active_admin/inputs/filter_select_input.rb +5 -1
  39. data/lib/active_admin/locales/bg.yml +1 -0
  40. data/lib/active_admin/locales/ca.yml +1 -0
  41. data/lib/active_admin/locales/cs.yml +9 -1
  42. data/lib/active_admin/locales/da.yml +1 -0
  43. data/lib/active_admin/locales/de.yml +16 -3
  44. data/lib/active_admin/locales/en.yml +1 -0
  45. data/lib/active_admin/locales/es.yml +1 -0
  46. data/lib/active_admin/locales/fr.yml +5 -1
  47. data/lib/active_admin/locales/he.yml +3 -2
  48. data/lib/active_admin/locales/hr.yml +1 -0
  49. data/lib/active_admin/locales/hu.yml +1 -0
  50. data/lib/active_admin/locales/it.yml +5 -4
  51. data/lib/active_admin/locales/ja.yml +12 -12
  52. data/lib/active_admin/locales/ko.yml +1 -0
  53. data/lib/active_admin/locales/lt.yml +81 -0
  54. data/lib/active_admin/locales/lv.yml +2 -1
  55. data/lib/active_admin/locales/nl.yml +1 -0
  56. data/lib/active_admin/locales/no-NB.yml +1 -0
  57. data/lib/active_admin/locales/pl.yml +1 -0
  58. data/lib/active_admin/locales/pt-BR.yml +3 -2
  59. data/lib/active_admin/locales/ro.yml +1 -0
  60. data/lib/active_admin/locales/ru.yml +7 -6
  61. data/lib/active_admin/locales/sv-SE.yml +1 -0
  62. data/lib/active_admin/locales/tr.yml +3 -2
  63. data/lib/active_admin/locales/vi.yml +1 -0
  64. data/lib/active_admin/locales/zh-CN.yml +1 -0
  65. data/lib/active_admin/locales/zh-TW.yml +1 -0
  66. data/lib/active_admin/menu_item.rb +6 -0
  67. data/lib/active_admin/page.rb +3 -0
  68. data/lib/active_admin/page_presenter.rb +2 -0
  69. data/lib/active_admin/resource.rb +12 -1
  70. data/lib/active_admin/resource/menu.rb +8 -1
  71. data/lib/active_admin/resource_controller.rb +3 -1
  72. data/lib/active_admin/resource_controller/collection.rb +1 -1
  73. data/lib/active_admin/resource_controller/decorators.rb +19 -0
  74. data/lib/active_admin/resource_dsl.rb +1 -1
  75. data/lib/active_admin/version.rb +1 -1
  76. data/lib/active_admin/view_helpers.rb +1 -0
  77. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
  78. data/lib/active_admin/view_helpers/download_format_links_helper.rb +50 -0
  79. data/lib/active_admin/view_helpers/fields_for.rb +4 -0
  80. data/lib/active_admin/view_helpers/flash_helper.rb +13 -0
  81. data/lib/active_admin/views/components/paginated_collection.rb +2 -11
  82. data/lib/active_admin/views/components/table_for.rb +21 -27
  83. data/lib/active_admin/views/footer.rb +3 -1
  84. data/lib/active_admin/views/index_as_block.rb +1 -1
  85. data/lib/active_admin/views/index_as_grid.rb +1 -1
  86. data/lib/active_admin/views/pages/base.rb +3 -3
  87. data/lib/active_admin/views/pages/index.rb +1 -7
  88. data/lib/active_admin/views/title_bar.rb +6 -3
  89. data/lib/generators/active_admin/devise/devise_generator.rb +1 -1
  90. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +6 -3
  91. data/lib/generators/active_admin/install/templates/admin_user.rb.erb +1 -1
  92. data/lib/generators/active_admin/install/templates/dashboard.rb +2 -2
  93. data/lib/generators/active_admin/install/templates/migrations/2_move_admin_notes_to_comments.rb +2 -1
  94. data/spec/integration/memory_spec.rb +1 -1
  95. data/spec/support/rails_template.rb +41 -2
  96. data/spec/support/rails_template_with_data.rb +2 -1
  97. data/spec/support/templates/en.yml +2 -0
  98. data/spec/support/templates/post_decorator.rb +53 -0
  99. data/spec/unit/application_spec.rb +17 -4
  100. data/spec/unit/belongs_to_spec.rb +1 -1
  101. data/spec/unit/config_shared_examples.rb +15 -7
  102. data/spec/unit/controller_filters_spec.rb +8 -8
  103. data/spec/unit/csv_builder_spec.rb +10 -0
  104. data/spec/unit/devise_spec.rb +28 -7
  105. data/spec/unit/filters/filter_form_builder_spec.rb +24 -0
  106. data/spec/unit/filters/resource_spec.rb +15 -1
  107. data/spec/unit/form_builder_spec.rb +4 -0
  108. data/spec/unit/resource_controller_spec.rb +67 -3
  109. data/spec/unit/resource_spec.rb +17 -0
  110. data/spec/unit/view_helpers/download_format_links_helper_spec.rb +39 -0
  111. data/spec/unit/view_helpers/fields_for_spec.rb +5 -0
  112. data/spec/unit/views/components/table_for_spec.rb +31 -0
  113. data/spec/unit/views/pages/layout_spec.rb +1 -1
  114. data/spec/unit/views/pages/show_spec.rb +21 -0
  115. data/tasks/parallel_tests.rake +60 -0
  116. data/tasks/test.rake +2 -1
  117. metadata +44 -26
@@ -27,6 +27,7 @@ ko:
27
27
  less_than: "작다"
28
28
  main_content: "내용을 보시려면 %{model}#main_content 를 구현해 주시기 바랍니다."
29
29
  logout: "로그아웃"
30
+ powered_by: "Powered by %{active_admin} %{version}"
30
31
  sidebars:
31
32
  filters: "필터 목록"
32
33
  pagination:
@@ -0,0 +1,81 @@
1
+ lt:
2
+ active_admin:
3
+ dashboard: Valdymo skydelis
4
+ dashboard_welcome:
5
+ welcome: "Sveiki atvykę į Active Admin. Tai yra numatytasis valdymo skydelis."
6
+ call_to_action: 'Norėdami pridėti skydelyje skyrius, žiūrėkite app/admin/dashboards.rb'
7
+ view: 'Žiūrėti'
8
+ edit: 'Redaguoti'
9
+ delete: 'Šalinti'
10
+ delete_confirmation: 'Ar jūs tikrai norite tai pašalinti?'
11
+ new_model: 'Naujas %{model}'
12
+ create_model: 'Naujas %{model}'
13
+ edit_model: 'Redaguoti %{model}'
14
+ update_model: 'Redaguoti %{model}'
15
+ delete_model: 'Pašalinti %{model}'
16
+ details: '%{model} Informacija'
17
+ cancel: 'Atšaukti'
18
+ empty: 'Tuščia'
19
+ previous: 'Atgal'
20
+ next: 'Toliau'
21
+ download: 'Atsisiųsti'
22
+ has_many_new: 'Pridėti naują %{model}'
23
+ has_many_delete: 'Šalinti'
24
+ filter: 'Filtras'
25
+ clear_filters: 'Išvalyti filtrus'
26
+ search_field: 'Paieškos %{field}'
27
+ equal_to: 'lygus'
28
+ greater_than: 'didesnis nei'
29
+ less_than: 'mažiau nei'
30
+ main_content: 'Prašome realizuoti %{model}#main_content turiniui vaizduoti.'
31
+ logout: 'Išeiti'
32
+ powered_by: "Powered by %{active_admin} %{version}"
33
+ sidebars:
34
+ filters: 'Filtrai'
35
+ pagination:
36
+ empty: '%{model} nerastas'
37
+ one: 'Rodoma <B> 1 </ b> %{model}'
38
+ one_page: 'Rodoma <b>visi %{n} </ b> %{model}'
39
+ multiple: 'Rodomi %{model} <b>%{iš}&nbsp;-&nbsp;%{to} </ b> iš<b>%{total} </ b> iš viso'
40
+ entry:
41
+ one: 'įrašas'
42
+ other: 'įrašai'
43
+ any: 'Bet kokia'
44
+ blank_slate:
45
+ content: 'Nėra %{resource_name}.'
46
+ link: 'Sukurti'
47
+ batch_actions:
48
+ button_label: 'Veiksmai su pažymėtais'
49
+ delete_confirmation: 'Ar jūs tikrai norite pašalinti šiuos %{plural_model}? Pašalinus negalėsite atstatyti?'
50
+ succesfully_destroyed:
51
+ one: 'Sėkmingai pašalintas 1 %{model}'
52
+ other: 'Sėkmingai pašalinti %{count} %{plural_model}'
53
+ selection_toggle_explanation: '(Žymėti)'
54
+ link: 'Sukurti'
55
+ action_label: '%{title} Pasirinkta'
56
+ labels:
57
+ destroy: 'Šalinti'
58
+ comments:
59
+ body: 'Kūno'
60
+ author: 'Autorius'
61
+ title: 'Komentaras'
62
+ add: 'Pridėti komentarą'
63
+ resource: 'Išteklių'
64
+ no_comments_yet: 'Dar nėra komentarų.'
65
+ title_content: 'Komentarai (%{count})'
66
+ errors:
67
+ empty_text: 'komentaras neišsaugotas, tekstas buvo tuščias.'
68
+ devise:
69
+ login:
70
+ title: 'Prisijungti'
71
+ remember_me: 'Prisimink mane'
72
+ submit: 'Prisijungti'
73
+ reset_password:
74
+ title: 'Pamiršote slaptažodį?'
75
+ submit: 'Vėl nustatykite savo slaptažodį'
76
+ change_password:
77
+ title: 'Keisti slaptažodį'
78
+ submit: 'Keisti slaptažodį'
79
+ links:
80
+ sign_in: 'Prisijungti'
81
+ forgot_your_password: 'Pamiršote slaptažodį?'
@@ -29,6 +29,7 @@ lv:
29
29
  less_than: "Mazāks par"
30
30
  main_content: "Lūdzu implementēt %{model}#main_content, lai rādītos saturs."
31
31
  logout: "Iziet"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filtri"
34
35
  pagination:
@@ -43,7 +44,7 @@ lv:
43
44
  blank_slate:
44
45
  content: "Sadaļā '%{resource_name}' nav neviena ieraksta."
45
46
  link: "Izveidot jaunu"
46
- comments:
47
+ comments:
47
48
  body: "Saturs"
48
49
  author: "Autors"
49
50
  title: "Komentārs"
@@ -29,6 +29,7 @@ nl:
29
29
  less_than: "Kleiner dan"
30
30
  main_content: "Implementeer %{model}#main_content om de content weer te geven."
31
31
  logout: "Uitloggen"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filters"
34
35
  pagination:
@@ -27,6 +27,7 @@
27
27
  less_than: "Mindre enn"
28
28
  main_content: "Please implement %{model}#main_content to display content."
29
29
  logout: "Logg ut"
30
+ powered_by: "Powered by %{active_admin} %{version}"
30
31
  sidebars:
31
32
  filters: "Filtere"
32
33
  pagination:
@@ -29,6 +29,7 @@ pl:
29
29
  less_than: "Mniejsze niż"
30
30
  main_content: "Zaimplementuj %{model}#main_content aby wyświetlić treść."
31
31
  logout: "Wyloguj"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filtry"
34
35
  pagination:
@@ -29,6 +29,7 @@
29
29
  less_than: "Menor Que"
30
30
  main_content: "Por favor implemente %{model}#main_content para exibir conteúdo."
31
31
  logout: "Sair"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filtros"
34
35
  pagination:
@@ -54,7 +55,7 @@
54
55
  action_label: "%{title} Selecionado"
55
56
  labels:
56
57
  destroy: "Excluído"
57
- comments:
58
+ comments:
58
59
  body: "Conteúdo"
59
60
  author: "Autor"
60
61
  title: "Comentário"
@@ -77,4 +78,4 @@
77
78
  submit: "Troque minha senha"
78
79
  links:
79
80
  sign_in: "Entrar"
80
- forgot_your_password: "Esqueceu sua senha?"
81
+ forgot_your_password: "Esqueceu sua senha?"
@@ -29,6 +29,7 @@ ro:
29
29
  less_than: "Mai Mic Decat"
30
30
  main_content: "Va rugam sa implementati %{model}#main_content pentru a afisa continut."
31
31
  logout: "Iesire"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filtre"
34
35
  pagination:
@@ -8,12 +8,12 @@ ru:
8
8
  edit: "Изменить"
9
9
  delete: "Удалить"
10
10
  delete_confirmation: "Вы уверены, что хотите удалить это?"
11
- new_model: "Создать"
11
+ new_model: "Создать %{model}"
12
12
  create_model: "Создать %{model}"
13
- edit_model: "Изменить"
13
+ edit_model: "Изменить %{model}"
14
14
  update_model: "Изменить %{model}"
15
- delete_model: "Удалить"
16
- details: "Подробнее"
15
+ delete_model: "Удалить %{model}"
16
+ details: "%{model} подробнее"
17
17
  cancel: "Отмена"
18
18
  empty: "Пусто"
19
19
  previous: "Пред."
@@ -29,6 +29,7 @@ ru:
29
29
  less_than: "меньше"
30
30
  main_content: "Создайте %{model}#main_content для отображения содержимого."
31
31
  logout: "Выйти"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Фильтры"
34
35
  pagination:
@@ -45,7 +46,7 @@ ru:
45
46
  link: "Создать"
46
47
  batch_actions:
47
48
  button_label: "Групповые операции"
48
- delete_confirmation: "Вы уверены, что хотите удалить это? Вы не сможете это отменить."
49
+ delete_confirmation: "Вы уверены, что хотите удалить %{plural_model}? Вы не сможете это отменить."
49
50
  succesfully_destroyed:
50
51
  one: "Успешно удалено: 1 %{model}"
51
52
  other: "Успешно удалено: %{count} %{plural_model}"
@@ -54,7 +55,7 @@ ru:
54
55
  action_label: "%{title} выбранное"
55
56
  labels:
56
57
  destroy: "Удалить"
57
- comments:
58
+ comments:
58
59
  body: "Текст"
59
60
  author: "Автор"
60
61
  title: "Комментарий"
@@ -29,6 +29,7 @@
29
29
  less_than: "Mindre än"
30
30
  main_content: "Implementera %{model}#main_content för att kunna visa något."
31
31
  logout: "Logga ut"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filter"
34
35
  pagination:
@@ -29,6 +29,7 @@ tr:
29
29
  less_than: "Küçükse"
30
30
  main_content: "İçeriği görüntülemek için lütfen %{model}#main_content metodunu ekleyin."
31
31
  logout: "Oturumu Sonlandır"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Filtreler"
34
35
  pagination:
@@ -45,10 +46,10 @@ tr:
45
46
  link: "Bir tane oluşturun"
46
47
  batch_actions:
47
48
  button_label: "Toplu işlemler"
48
- delete_confirmation: "%{singular_model} kayıtlarını silmek istediğinize emin misiniz? Dikkat bu işlemin geri dönüşü yoktur!"
49
+ delete_confirmation: "%{plural_model} kayıtlarını silmek istediğinize emin misiniz? Dikkat bu işlemin geri dönüşü yoktur!"
49
50
  succesfully_destroyed:
50
51
  one: "1 %{model} kaydı başarıyla silindi."
51
- other: "Toplam %{count} kayıt %{singular_model} modelinden silindi"
52
+ other: "Toplam %{count} kayıt %{plural_model} modelinden silindi"
52
53
  selection_toggle_explanation: "Seçimi Değiştir"
53
54
  link: "Ekle"
54
55
  action_label: "%{title} Seçildi"
@@ -29,6 +29,7 @@ vi:
29
29
  less_than: "Nhỏ hơn"
30
30
  main_content: "Xin bổ sung %{model}#main_content để hiển thị nội dung."
31
31
  logout: "Đăng xuất"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "Bộ Lọc"
34
35
  pagination:
@@ -29,6 +29,7 @@
29
29
  less_than: "小于"
30
30
  main_content: "请执行 %{model}#main_content 来显示内容."
31
31
  logout: "退出"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "所有条件"
34
35
  pagination:
@@ -29,6 +29,7 @@
29
29
  less_than: "小於"
30
30
  main_content: "請編寫 %{model}#main_content 以顯示內容。"
31
31
  logout: "登出"
32
+ powered_by: "Powered by %{active_admin} %{version}"
32
33
  sidebars:
33
34
  filters: "篩選條件"
34
35
  pagination:
@@ -28,12 +28,18 @@ module ActiveAdmin
28
28
  # @option options [Proc] :if
29
29
  # A block for the view to call to decide if this menu item should be displayed.
30
30
  # The block should return true of false
31
+ #
32
+ # @option options [Proc] :parent
33
+ # The parent label to display for this menu item. Menu item will be nested
34
+ # under that label. It can either be a String or a Proc. If the option is Proc,
35
+ # it is called each time the label is requested.
31
36
  def initialize(options = {})
32
37
  @label = options[:label]
33
38
  @id = MenuItem.generate_item_id(options[:id] || label)
34
39
  @url = options[:url]
35
40
  @priority = options[:priority] || 10
36
41
  @children = Menu::ItemCollection.new
42
+ @parent = options[:parent]
37
43
 
38
44
  @display_if_block = options[:if]
39
45
 
@@ -17,6 +17,9 @@ module ActiveAdmin
17
17
 
18
18
  # An array of custom actions defined for this page
19
19
  attr_reader :page_actions
20
+
21
+ # Set breadcrumb builder
22
+ attr_accessor :breadcrumb
20
23
 
21
24
  module Base
22
25
  def initialize(namespace, name, options)
@@ -18,6 +18,8 @@ module ActiveAdmin
18
18
 
19
19
  attr_reader :block, :options
20
20
 
21
+ delegate :has_key?, :to => :options
22
+
21
23
  def initialize(options = {}, &block)
22
24
  @options, @block = options, block
23
25
  end
@@ -46,10 +46,17 @@ module ActiveAdmin
46
46
 
47
47
  # Set the configuration for the CSV
48
48
  attr_writer :csv_builder
49
+
50
+ # Set breadcrumb builder
51
+ attr_accessor :breadcrumb
49
52
 
50
53
  # Store a reference to the DSL so that we can dereference it during garbage collection.
51
54
  attr_accessor :dsl
52
55
 
56
+ # The string identifying a class to decorate our resource with for the view.
57
+ # nil to not decorate.
58
+ attr_accessor :decorator_class_name
59
+
53
60
  module Base
54
61
  def initialize(namespace, resource_class, options = {})
55
62
  @namespace = namespace
@@ -76,6 +83,10 @@ module ActiveAdmin
76
83
  ActiveSupport::Dependencies.constantize(resource_class_name)
77
84
  end
78
85
 
86
+ def decorator_class
87
+ ActiveSupport::Dependencies.constantize(decorator_class_name) if decorator_class_name
88
+ end
89
+
79
90
  def resource_table_name
80
91
  resource_class.quoted_table_name
81
92
  end
@@ -163,6 +174,6 @@ module ActiveAdmin
163
174
  def default_csv_builder
164
175
  @default_csv_builder ||= CSVBuilder.default_for_resource(resource_class)
165
176
  end
166
-
177
+
167
178
  end # class Resource
168
179
  end # module ActiveAdmin
@@ -9,7 +9,7 @@ module ActiveAdmin
9
9
  @display_menu = false
10
10
  else
11
11
  options = default_menu_options.merge(options)
12
- @parent_menu_item = options.delete(:parent)
12
+ @parent_menu_item = value_or_proc(options.delete(:parent))
13
13
  @menu_item = MenuItem.new(default_menu_options.merge(options))
14
14
  end
15
15
  end
@@ -37,6 +37,13 @@ module ActiveAdmin
37
37
  @display_menu != false
38
38
  end
39
39
 
40
+ private
41
+
42
+ # Evaluates value if this is proc or return value if else
43
+ def value_or_proc(value)
44
+ return value.call if value.is_a? Proc
45
+ value
46
+ end
40
47
  end
41
48
  end
42
49
  end
@@ -3,6 +3,7 @@ require 'active_admin/resource_controller/actions'
3
3
  require 'active_admin/resource_controller/action_builder'
4
4
  require 'active_admin/resource_controller/callbacks'
5
5
  require 'active_admin/resource_controller/collection'
6
+ require 'active_admin/resource_controller/decorators'
6
7
  require 'active_admin/resource_controller/scoping'
7
8
  require 'active_admin/resource_controller/sidebars'
8
9
  require 'active_admin/resource_controller/resource_class_methods'
@@ -22,6 +23,7 @@ module ActiveAdmin
22
23
  include ActionBuilder
23
24
  include Callbacks
24
25
  include Collection
26
+ include Decorators
25
27
  include Scoping
26
28
  include Sidebars
27
29
  extend ResourceClassMethods
@@ -35,7 +37,7 @@ module ActiveAdmin
35
37
  end
36
38
  end
37
39
 
38
- # Inherited Resources uses the inherited(base) hook method to
40
+ # Inherited Resources uses the inherited(base) hook method to
39
41
  # add in the Base.resource_class class method. To override it, we
40
42
  # need to install our resource_class method each time we're inherited from.
41
43
  def inherited(base)
@@ -126,7 +126,7 @@ module ActiveAdmin
126
126
  page = params[Kaminari.config.param_name]
127
127
 
128
128
  chain.send(page_method_name, page).per(per_page)
129
- end
129
+ end
130
130
 
131
131
  def per_page
132
132
  return max_csv_records if request.format == 'text/csv'
@@ -0,0 +1,19 @@
1
+ module ActiveAdmin
2
+ class ResourceController < BaseController
3
+ module Decorators
4
+ protected
5
+
6
+ def resource
7
+ decorator = active_admin_config.decorator_class
8
+ resource = super
9
+ decorator ? decorator.new(resource) : resource
10
+ end
11
+
12
+ def active_admin_collection
13
+ decorator = active_admin_config.decorator_class
14
+ collection = super
15
+ decorator ? decorator.decorate(collection) : collection
16
+ end
17
+ end
18
+ end
19
+ end
@@ -68,7 +68,7 @@ module ActiveAdmin
68
68
  # column("Author") { |post| post.author.full_name }
69
69
  # end
70
70
  #
71
- # csv :separator => ";" do
71
+ # csv :separator => ";", :options => { :force_quotes => true } do
72
72
  # column :name
73
73
  # end
74
74
  #
@@ -1,3 +1,3 @@
1
1
  module ActiveAdmin
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
@@ -15,6 +15,7 @@ module ActiveAdmin
15
15
  include FormHelper
16
16
  include TitleHelper
17
17
  include ViewFactoryHelper
18
+ include FlashHelper
18
19
 
19
20
  end
20
21
  end
@@ -19,7 +19,7 @@ module ActiveAdmin
19
19
  # ignored
20
20
  end
21
21
  end
22
-
22
+
23
23
  name ||= I18n.t("activerecord.models.#{part.singularize}", :count => 1.1, :default => part.titlecase)
24
24
 
25
25
  crumbs << link_to( name, "/" + parts[0..index].join('/'))