Advertisement
Guest User

rails_admin.rb

a guest
Sep 10th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. require Rails.root.join('lib', 'rails_admin_pending_tasks.rb')
  2.  
  3. RailsAdmin.config do |config|
  4.  
  5. # Custom Action to show pending tasks
  6. module RailsAdmin
  7. module Config
  8. module Actions
  9. class Pending < RailsAdmin::Config::Actions::Base
  10. RailsAdmin::Config::Actions.register(self)
  11. end
  12. end
  13. end
  14. end
  15.  
  16.  
  17.  
  18.  
  19. ### Popular gems integration
  20.  
  21. ## == Devise ==
  22. config.authenticate_with do
  23. warden.authenticate! scope: :admin
  24. end
  25. config.current_user_method(&:current_admin)
  26.  
  27. ## == Cancan ==
  28. # config.authorize_with :cancan
  29.  
  30. ## == PaperTrail ==
  31. config.audit_with :paper_trail, 'User', '::PaperTrail::Version' # PaperTrail >= 3.0.0
  32.  
  33. ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
  34.  
  35. config.actions do
  36. dashboard # mandatory
  37. index # mandatory
  38. new
  39. export
  40. bulk_delete
  41. show
  42. edit
  43. delete
  44. show_in_app
  45. import
  46.  
  47. ## With an audit adapter, you can add:
  48. history_index
  49. history_show
  50.  
  51. # Add the nestable action for configured models
  52. nestable
  53.  
  54. pending do
  55. # Make it visible only for article model. You can remove this if you don't need.
  56. visible do
  57. true
  58. # bindings[:abstract_model].model.to_s == "Task"
  59. end
  60. end
  61. end
  62.  
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement