Sha256: 800227f0082b2a7cdff59ea8987e6ec885e398297acc4e67c39b43335268fca1

Contents?: true

Size: 466 Bytes

Versions: 18

Compression:

Stored size: 466 Bytes

Contents

require 'action_controller'

module ReactiveRuby
  module Rails
    class ActionController::Base
      def render_component(*args)
        @component_name = ((args[0].is_a? Hash) || args.empty?) ? params[:action].camelize : args.shift
        @render_params = (args[0].is_a? Hash) ? args[0] : {}
        render inline: "<%= react_component @component_name, @render_params, { prerender: !params[:no_prerender] } %>", layout: 'application'
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
reactrb-0.8.1 lib/reactive-ruby/rails/controller_helper.rb
reactrb-0.8.0 lib/reactive-ruby/rails/controller_helper.rb
reactrb-0.7.42 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.41 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.40 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.39 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.38 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.36 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.35 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.34 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.33 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.32 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.31 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.30 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.29 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.28 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.27 lib/reactive-ruby/rails/controller_helper.rb
reactive-ruby-0.7.26 lib/reactive-ruby/rails/controller_helper.rb