def render_notification_of(target, options = {})
      return unless target.is_a? ActivityNotification::Target

      # Prepare content for notifications index
      notification_options = options.merge( target: target.to_resources_name,
                                            partial: options[:notification_partial],
                                            layout: options[:notification_layout] )
      index_options = options.slice( :limit, :reverse, :with_group_members, :as_latest_group_member,
                                     :filtered_by_group, :filtered_by_group_type, :filtered_by_group_id,
                                     :filtered_by_type, :filtered_by_key, :custom_filter )
      notification_index = load_notification_index(target, options[:index_content], index_options)
      prepare_content_for(target, notification_index, notification_options)

      # Render partial index
      render_partial_index(target, options)
    end
def render_notification_of(target, options = {})
      return unless target.is_a? ActivityNotification::Target

      # Prepare content for notifications index
      notification_options = options.merge( target: target.to_resources_name,
                                            partial: options[:notification_partial],
                                            layout: options[:notification_layout] )
      index_options = options.slice( :limit, :reverse, :with_group_members, :as_latest_group_member,
                                     :filtered_by_group, :filtered_by_group_type, :filtered_by_group_id,
                                     :filtered_by_type, :filtered_by_key, :custom_filter )
      notification_index = load_notification_index(target, options[:index_content], index_options)
      prepare_content_for(target, notification_index, notification_options)

      # Render partial index
      render_partial_index(target, options)
    end
View helper for rendering on notifications of the target to embedded partial template.
 It calls {Notification#render} to prepare view as `content_for :index_content`
 and render partial index calling `yield :index_content` internally.
 For example, this method can be used for notification index as dropdown in common header.
 @todo Show examples

 @param [Object] target Target instance of the rendering notifications
 @param [Hash] options Options for rendering notifications
 @option options [String, Symbol] :target                 (nil)       Target type name to find template or i18n text
 @option options [Symbol]         :index_content          (:with_attributes) Option method to load target notification index, [:simple, :unopened_simple, :opened_simple, :with_attributes, :unopened_with_attributes, :opened_with_attributes, :none] are available
 @option options [String]         :partial_root           ("activity_notification/notifications/#{target.to_resources_name}", 'activity_notification/notifications/default') Root path of partial template
 @option options [String]         :notification_partial   ("activity_notification/notifications/#{target.to_resources_name}", controller.target_view_path, 'activity_notification/notifications/default') Partial template name of the notification index content
 @option options [String]         :layout_root            ('layouts') Root path of layout template
 @option options [String]         :notification_layout    (nil)       Layout template name of the notification index content
 @option options [String]         :fallback               (nil)       Fallback template to use when MissingTemplate is raised. Set :text to use i18n text as fallback.
 @option options [String]         :partial                ('index')   Partial template name of the partial index
 @option options [String]         :routing_scope          (nil)       Routing scope for notification and subscription routes
 @option options [Boolean]        :devise_default_routes  (false)     If links in default views will be handles as devise default routes
 @option options [String]         :layout                 (nil)       Layout template name of the partial index
 @option options [Integer]        :limit                  (nil)       Limit to query for notifications
 @option options [Boolean]        :reverse                (false)     If notification index will be ordered as earliest first
 @option options [Boolean]        :with_group_members     (false)     If notification index will include group members
 @option options [String]         :filtered_by_type       (nil)       Notifiable type for filter
 @option options [Object]         :filtered_by_group      (nil)       Group instance for filter
 @option options [String]         :filtered_by_group_type (nil)       Group type for filter, valid with :filtered_by_group_id
 @option options [String]         :filtered_by_group_id   (nil)       Group instance id for filter, valid with :filtered_by_group_type
 @option options [String]         :filtered_by_key        (nil)       Key of the notification for filter
 @option options [Array]          :custom_filter          (nil)       Custom notification filter (e.g. ["created_at >= ?", time.hour.ago])
 @return [String] Rendered view or text as string