Sha256: edf9c2af2eeb1036cb71510ca25c57f5111b75c1d25e38d18f639d8d4261d61d

Contents?: true

Size: 885 Bytes

Versions: 1

Compression:

Stored size: 885 Bytes

Contents

module C80Swiper
  module AppHelper

    def swipe(swslider_id=nil, effect='slide')

      swslider = swslider_id.nil? ?
          C80Swiper::Swslider.first :
          C80Swiper::Swslider.find(swslider_id)

      render :partial => 'c80_swiper/swipe',
             :locals => {
                 frames: swslider.sframes,
                 options: {
                     mark_pagination: true,
                     mark_buttons: true,
                     mark_scrollbar: false,
                     mark_lazy: false,
                     params: {
                         effect: effect
                     }
                 }
             }
    rescue => e
      Rails.logger.debug "[TRACE] <app_helper.swipe> #{e}"
      render :partial => 'c80_swiper/shared/swipe_error_message',
             :locals => {
                 error_message: "#{e}"
             }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_swiper-0.1.0 app/helpers/c80_swiper/app_helper.rb