Questions tagged [react.rb]

React.rb is a Ruby (Opal) ReactJS library wrapper for building user interfaces in pure Ruby. It uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible.

PURE RUBY

React.rb lets you build beautiful interactive user interfaces using the same Ruby language running your server side code. React.rb replaces JS code, JSX, HTML, templating languages, and complex frameworks with one simple system.

REACT + RUBY

The power and simplicity of React with a great easy to use Ruby DSL. React.rb frees you up to do what you do best - building great apps.

SIMPLICITY

One language. One simple model. Under the hood React.rb takes care of all the details for you. The same ruby code runs on the server to deliver pages fast, and then keeps running on the client to handle your user interactions.

27 questions
0
votes
1 answer

How do I import a JavaScript or JSX based component into React.rb so it is accessible in ruby?

Using the example given for React-Bootstrap and react.rb works perfectly but I am trying to get a NPN component called React-TimeAgo working and I am lost. This is what I have done: In index.js (for Webpack to import it into the webpack…
BarrieH
  • 373
  • 3
  • 11
0
votes
1 answer

How do I tell Rails not to pre-render components?

When using React.rb how do I keep Rails from prerendering the components?
Ken Stipek
  • 1,512
  • 8
  • 12
0
votes
1 answer

Moving devise model to React.rb public directory calls method missing

I'm trying to use Devise with React.rb, so I thought I'll move my user model to the public directory to be able to edit it through React, however I get this…
MRifat
  • 621
  • 5
  • 7
0
votes
1 answer

Errors when integrating reactive-record with react-rails

I'm having trouble adding reactive-record to my project. Gemfile: gem 'rails', '4.2.4' gem 'bootstrap-sass' #, '~> 3.3.6' gem 'sprockets-rails' source 'https://rails-assets.org' do gem 'rails-assets-tether', '>= 1.1.0' end gem 'pg' gem…
Jamie A.
  • 85
  • 1
  • 7
0
votes
1 answer

Can't set defaultValue using react.rb

My code is input(type: "text", name: "name", defalut_value: obj.name) and I try this too input(type: "text", name: "name", defalutValue: obj.name) I always got with no…
贾延平
  • 68
  • 3
0
votes
1 answer

How do I generate more than one dom element from a react.rb component

I am trying to get the following code working: class HelloWorld < React::Component::Base # stuff def render div { "hello" } div { "goodby" } end end but I keep getting this error: Exception raised while rendering #
Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29
0
votes
2 answers

Embedding serverside Ruby to opal files in rails

Is it possible to embed serverside ruby to Opal .js.rb files? In other words I need to access for example User.find(1) in some opal file in Rails, like one would do with .erb.
ClassyPimp
  • 715
  • 7
  • 20
0
votes
1 answer

Requests for a form that submits through ajax multiply with each subsequent submit

I have a form that makes an ajax request, the problem is that every time I click on it, the amount of times it makes that request multiplies. Now I'm sure it's because of the way I've set up submit-intercept but I don't know how else to do it…
Thermatix
  • 2,757
  • 21
  • 51
0
votes
1 answer

opal-jquery ajax request sending malformed json string

I'm using opal-jquery to send an ajax request to my backend, but the json payload is malformed when I try to access it on the backend. When I do puts @params.to_s on my back end, it gets displays as: {"{\"username\":\"some_user\",…
Thermatix
  • 2,757
  • 21
  • 51
0
votes
1 answer

Having trouble with opal and trying to render out a simple react.rb template

I'm trying to use the react.rb gem with opal however I'm having trouble with it. The following is a simple hello world component, nothing complex. class Hello_World include React::Component define_state(:message) { "Hello World!" } def…
Thermatix
  • 2,757
  • 21
  • 51
0
votes
1 answer

reset react.js between tests

I am using React.rb (a opal-ruby binding to react.js) and Opal-rspec for testing. It seems like I need to reset react's internals between tests as I am getting the awful "Cannot read property ‘firstChild’ of undefined" error, in some tests. If I…
Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29
1
2