Questions tagged [react-rails]

Regarding React.js + Ruby on Rails, especially the `react-rails` gem.

react-rails is a Ruby gem for integrating React.js into a Ruby on Rails application. Topics include transforming JSX, mounting React components into Rails views, and rendering React components on the server. Learn more on Github: https://github.com/reactjs/react-rails.

282 questions
0
votes
1 answer

How to implement each_slice in rails-react views?

I have Parent component Monsters, there i render Monster component. for monster in @state.monsters React.createElement Monster, key: monster.id, monster: monster, team: @state.team... Inside monster: div className: 'col-md-4', hr {} img …
0
votes
1 answer

React-Rails: How to render a component with a ref?

At the moment I render my component inside a .erb file like this: <%= react_component('Counter', number: @counter) %> This component has a function that uses promised-xhr: push: function(operation) { if(operation) { new_number =…
Matias Faure
  • 822
  • 1
  • 9
  • 20
0
votes
1 answer

React Component rendering to string for some reason

For some reason, parts of my React component are rendering to string. I'm using Rails with the react-rails gem and the sprockets-coffee-react gem to use JSX with Coffeescript. Here's the code show.html.erb <%= react_component 'ArticleForm', {action:…
chintanparikh
  • 1,632
  • 6
  • 22
  • 36
0
votes
1 answer

Only load React compontent on some pages with react-rails

I have a ReactJS component that I want to mount to #test-scores on user/show.html. The component lives in app/assets/javascripts/react-components/test-score.js.jsx. How can I make sure it's only loaded when the user visits user/show? It is loaded…
martins
  • 9,669
  • 11
  • 57
  • 85
0
votes
1 answer

react-rails: Call method of a component like window.Component.method

is it possible to call a specific method of a component? window.Component.method doesn't work... Any help is appreciated, thanks in advance.
Tom
  • 520
  • 2
  • 17
0
votes
1 answer

react-rails gem call component when data is ready

I'm trying to call component in render function, when the data is ready, or return null. I don't know why, but react-rails gem return Parse Error in this string. Source code is below: var PlayersData = React.createClass({ loadDataFromServer:…
MaxH
  • 11
  • 3
-1
votes
1 answer

Using react_component() to add react components in haml files

While working with the react-rails library, we can use the react_component() function in an .erb file to add a react component. How can we use the same function in a .haml file? Or do we have another way of adding a react component in a haml file?
Karan Sapolia
  • 640
  • 9
  • 18
-1
votes
1 answer

npm install bootstrap-material-datepicker

I'm working with React and Rails and implementing material design in my app. I'm loading the modules using webpack. I have been able to get bootstrap-material-design and moment.js through npm but now, i want to integrate bootstrap material…
-1
votes
2 answers

Rails name error after Json

I have two JSON file in my rails project index.json.jbuilder json.array! @restaurants, partial: 'restaurants/restaurant', as: :restaurant and _restaurant.json.jbuilder json.(restraurant, :id, :name, :address, :description) When i render my…
Cihan Zengin
  • 103
  • 2
  • 12
-1
votes
1 answer

react-router-rails server side renders the correct component, but bypasses the parent component

I'm trying to write an app in ruby on rails with server side rendering using flux, react-rails, react-router-rails and browserify, pretty much based in this tutorial and this repo. So far I've managed to write a simple two-level routeing…
-2
votes
1 answer

Import React library Ruby On Rails

Having knowledge of Ruby, I decided to start developing a web application with RoR.Since I didn't find a front-end framework for RoR, I decided to go for React. That's how I found the gem react-rails. However, I don't know how to import a React…
mamenejr
  • 305
  • 9
  • 17
1 2 3
18
19