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 safely to pass params to react component with react-rails

I'm using react-rails to add some react componenets to an existing ruby on rails app. I just realized that all the props being passed initially to the component are easily seen if you inspect the component <%= react_component('ProfileWeeklyWriting',…
gwalshington
  • 1,418
  • 2
  • 30
  • 60
0
votes
0 answers

How to change React focus, if app was rendered twice?

I render my application using react-rails gem, within erb template, but there is problem - template rendered two times, so I have two rendered react apps at the same time. There is no way for me to affect that logic, I just adding new feature to…
Gordienko R.
  • 331
  • 4
  • 16
0
votes
1 answer

Creating react components from array data

I am creating a fairly simple stats page for a dashboard in my rails application. I am using react-rails to create react components in my app and have one for a stat card. For these cards I have created a very simple react component import React…
Trenton Tyler
  • 1,692
  • 3
  • 24
  • 53
0
votes
1 answer

React Color Picker on bootstrap navbar

I added a ColorpickerBackground component to change the body background color of my app. This is working well... My problem is when I add a new component ColorpickerNavbar to change the color of my bootstrap (4) navbar it doesn't work as expected.…
0
votes
2 answers

How do I pass devise data to a React component?

I'm trying to pass Devise data to a React component. Devise is set up correctly, but I can't figure out how to pass the current_user info as props to my react_component. the React props current_user keeps logging as non-existent. I'm using React…
Aidan Low
  • 27
  • 1
  • 8
0
votes
1 answer

Render "namespaced" component react-rails

I'm currently using React with a Rails 5.2.0 application, with the react-rails gem. To keep a clean distribution of files, I want to store them within their specific folder, and for that I want to namespace the components I'm going to need. The…
0
votes
2 answers

Reactjs with Rails, remove duplicated createMuiTheme

the code below is one of my component. i am creating this with Ruby on Rails framework, with react_rails gem and webpacker, experimenting on Material UI. as you can see, i am changing the Material UI default font theme with my own choice of font.…
ckeat9
  • 162
  • 1
  • 14
0
votes
0 answers

react virtualized in react-rails

I am trying to use react virtualized in my react-rails code. I have the minified version of the library and added the require statement in application.js Yet, when I try to create a List, it shows List not defined error. application.js //= require…
0
votes
1 answer

Identifier '(function(opts, pluginOpts) {return eval(process' undefined - ExecJS::ProgramError in Home#index

I am a beginner at react/rails thing. Now that I have to build app immediately. I am getting an error that I am not familiar with. I have been working on it so much. Atlast, I am here in stack overflow. Because I know we have people here who can…
Stevan
  • 3
  • 3
0
votes
1 answer

How Can I Select Multiple CheckBox Buttons in Reactjs and Rails api

toggleCheckbox = (type) => { if(this.state.active_class === type) { this.setState({active_class:'health'}); } else { this.setState({ active_class: type }); } } This Button code called with above method The Above…
0
votes
0 answers

why is react-rails not attaching onClick event action to a button?

I'm using react-rails gem to add react components into my rails app. This is a code sample: let b = ; const element = React.createElement( 'button', { type: 'button', …
Vanddel
  • 1,094
  • 3
  • 13
  • 32
0
votes
0 answers

Why is stateless component using createReactClass in React-Rails not rendering?

Am having difficulty getting a component to render in a tutorial app am creating using React-Rails, can anyone have a look and point out where the problem could be please. I have googled around and searched stackoverflow but cant seem to find a…
All_J
  • 1
  • 2
0
votes
2 answers

change localhost port number in a rails application

I just started learning RoR as a backend technology for React. I came across a tutorial that uses 'react-rails' and it chooses the localhost port number to be 3000 for my development environment by default. Is there any way to change this default…
Raj
  • 3,637
  • 8
  • 29
  • 52
0
votes
1 answer

Bundler not able to use gem?

This is what is currently in my terminal. After Successfully setting up a rails app and making sure it worked. I set up the gem react-rails in my gem file. Then committed everything and from there I ran bundle install. Then I got an error stating…
0
votes
1 answer

react-rails View not being displayed properly

I am using react-rails to use React.js on my Rails project. Rails 4.2.8 This is what my assets/javascripts/application.js looks like //= require jquery //= require jquery_ujs //= require bootstrap-sprockets //= require bootstrap/modal //= require…
Sandip Subedi
  • 1,039
  • 1
  • 14
  • 34