module RenderWithView

Constants

VERSION

Public Instance Methods

render_with_view(*args) click to toggle source
# File lib/render_with_view.rb, line 8
def render_with_view *args
  if !args.first.is_a?(Hash)
    tmpl = args.shift
  else
    tmpl = action_name
  end
  locals = args.shift
  opts = args.shift || {}

  # save to ivar for testing purposes
  @__view__ = View.new(locals)

  render tmpl, opts.merge(locals: { view: @__view__ })
end