Sha256: e2d9438e5952b7284e6a4e0630b5a25c7ff55096cff90843b222fab0680d469d

Contents?: true

Size: 438 Bytes

Versions: 13

Compression:

Stored size: 438 Bytes

Contents

# frozen_string_literal: true
module ContentProviders
  # Selects a random slide from a slideshow to display.
  class RandomSlideProvider < BitCore::ContentProvider
    def render_current(options)
      slides = source_content.slides
      options.view_context.render(
        template: "think_feel_do_engine/slides/homepage",
        locals: {
          slide: slides.offset(rand(slides.count)).first
        }
      )
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.8 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.7 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.6 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.5 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.4 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.2 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.1 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.22.0 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.21.2 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.21.1 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.21.0 app/models/content_providers/random_slide_provider.rb
think_feel_do_engine-3.20.1 app/models/content_providers/random_slide_provider.rb