Sha256: a9883fb663188951e19e25cdb6839c26282a4d85f02200eb1f3e393c7566c8b6

Contents?: true

Size: 989 Bytes

Versions: 14

Compression:

Stored size: 989 Bytes

Contents

# app/views/components/home/show.rb

module Components
  
  module Home
    
    class Show

      include React::Component   # will create a new component named Show
      
      optional_param :say_hello_to
      backtrace :on
      def render  
        puts "Rendering my first component!"
        List(first_element: div { "bhwahaha" }) do
          "hello #{'there '+say_hello_to if say_hello_to}".span # render "hello" with optional 'there ...'
          "goodby".span  
        end
      end

    end
    
    class List
      
      include React::Component 
      
      required_param :first_element #, type: React::Element
      
      backtrace :on
      
      def render
        ul do
          li do
            first_element.render
          end
          children.each do |child|
            li do
              child.render(style: {color: :green})
              child.render(style: {color: :red})
            end
          end
        end
      end
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
reactive-ruby-0.7.27 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.26 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.25 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.24 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.23 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.22 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.21 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.20 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.19 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.18 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.17 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.16 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.15 example/rails-tutorial/app/views/components/home/show.rb
reactive-ruby-0.7.14 example/rails-tutorial/app/views/components/home/show.rb