Sha256: 4adfb63024810bf85107a0eb0f29f3fa7140d7fb75cd1df02710596a884ff08b

Contents?: true

Size: 704 Bytes

Versions: 2

Compression:

Stored size: 704 Bytes

Contents

module Slick
  module Rails
    # Example:
    #
    #     # app/controllers/application_controller.rb
    #     class ApplicationController < ActionController::Base
    #       view_helper Slick::Rails::ApplicationViewHelper, as: :slick_helper
    #     end
    #
    class ApplicationViewHelper < Rao::ViewHelper::Base
      # Example:
      #
      #     # app/layouts/application.html.haml
      #     = slick_helper(self).render_carousel()
      #
      def render_carousel(options = {}, &block)
        options.reverse_merge!(responsive: {})
        responsive = options.delete(:responsive)
        render(options: options, responsive: responsive.to_json, block: block)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slick-rails-0.0.3 app/view_helpers/slick/rails/application_view_helper.rb
slick-rails-0.0.2 app/view_helpers/slick/rails/application_view_helper.rb