Sha256: 4c9111bda5d795ad0517b6776252040673b74dce843ae8cc1b3a0ff3d5fa9b57

Contents?: true

Size: 261 Bytes

Versions: 1

Compression:

Stored size: 261 Bytes

Contents

module Responders
  module ViewVariantResponder
    def to_html
      if variant = request.headers["X-View-Variant"].presence
        action = controller.params[:action]
        render "#{action}.#{variant}"
      else
        super
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
view_variant_responder-0.1.0 lib/view_variant_responder.rb