Sha256: 4e705584a84f0180321b7ea3d3e3818e7288251b110b553486eb5f9954c82247

Contents?: true

Size: 1009 Bytes

Versions: 1

Compression:

Stored size: 1009 Bytes

Contents

module Cmor
  module Testimonials
    class ApplicationViewHelper < Rao::ViewHelper::Base
      def render_category(identifier, options = {})
        default_variant_options = Cmor::Testimonials::Configuration.image_variant_options[:category]
        options.reverse_merge!(
          autostart:       true,
          interval:        5.0,
          keyboard:        true,
          pause:           :hover,
          ride:            false,
          wrap:            true,
          controls:        true,
          indicators:      false,
          variant_options: default_variant_options,
          font_awesome:    false
        )
        category = Cmor::Testimonials::Category.where(identifier: identifier).first

        if category.present?
          render category: category, options: options
        end
      end

      private

      def render(locals = {})
        c.render partial: "/#{self.class.name.underscore}/#{caller_locations(1,1)[0].label}", locals: locals
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cmor_testimonials-0.0.8.pre app/view_helpers/cmor/testimonials/application_view_helper.rb