Module: Responders::ViewVariantResponder

Defined in:
lib/view_variant_responder.rb,
lib/view_variant_responder/version.rb

Constant Summary collapse

VERSION =
"0.1.0".freeze

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



3
4
5
6
7
8
9
10
# File 'lib/view_variant_responder.rb', line 3

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