Send email asynchroniously using Sidekiq.
Create your mailer us usual:
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This shows one technique for preserving filters on index pages for ActiveAdmin resources, without having to patch the ActiveAdmin core.
It restores any previously-used filters whenever the index page is rendered for a resource, unless the current request is an actual application of new filters. It also properly handles the clear-filters button (via a synchronous Ajax request that happens immediately before the normal filter form processing).
Yes, it's a bit of a hack, but it has worked well for me so far.
| ActiveAdmin.register_page "Dashboard" do | |
| menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") } | |
| content :title => proc{ I18n.t("active_admin.dashboard") } do | |
| # div :class => "blank_slate_container", :id => "dashboard_default_message" do | |
| # span :class => "blank_slate" do | |
| # span "Welcome to Active Admin. This is the default dashboard page." | |
| # small "To add dashboard sections, checkout 'app/admin/dashboards.rb'" | |
| # end |
| require 'yaml' | |
| require 'json' | |
| # require 'active_support/core_ext' | |
| #HashWithIndifferentAccess | |
| # app/models/ability.rb | |
| # All front end users are authorized using this class | |
| class Ability | |
| include CanCan::Ability | |
| def initialize(user) | |
| user ||= User.new | |
| can :read, :all |