ActionController::Renderer

#36 ActionController::Renderer
7/4/2016

Summary

ActionController::Renderer allows you to render arbitrary templates without requirement of being in controller actions.
2
rails view websockets render

Summary

irbApplication.controller.render(

  template: 'orders/index'

end

ApplicationController.render('orders/index')

OrdersController.render('index')

Available Renders

:template
:plain
:action
:html
:partial
:json
:file
:js
:inline
:xml

irb
users = Users.all UsersController.render('index', assigns: { users: users }, layout: false).squish
irbuser = User.first
UsersController.render(partial: 'user', locals: { user: user }).squish
irbApplicationController.renderer.defaults
renderer = ApplicationController.renderer.new(method: 'post', https: true)
renderer.render partial: 'users/user', locals: { user: user}