Sha256: 7a03146a3b023a8178d27601fc14d4f76b26d9cde93304b971164636e1ab20b0
Contents?: true
Size: 561 Bytes
Versions: 16
Compression:
Stored size: 561 Bytes
Contents
require 'action_controller' module ActionController # adds render_component helper to ActionControllers class Base def render_component(*args) @component_name = (args[0].is_a? Hash) || args.empty? ? params[:action].camelize : args.shift @render_params = args.shift || {} options = args[0] || {} render inline: '<%= react_component @component_name, @render_params, '\ '{ prerender: !params[:no_prerender] } %>', layout: options.key?(:layout) ? options[:layout].to_s : :default end end end
Version data entries
16 entries across 16 versions & 2 rubygems