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
1
vote
0 answers

ReactJS and javascript not displaying on Rails 5 app

The reactJS components and javascript codes don't display on my rails 5 app. I'm using react-rails gem and some plain JS with the asset pipeline. Here's my application.js manifest: //= require jquery //= require jquery_ujs //= require turbolinks //=…
Alecbrito
  • 11
  • 2
1
vote
0 answers

react-helmet with react-rails server side rendering

I'm trying to use react-helmet with react-rails and webpacker with server-side rendering enabled to enable handling the generation of meta tag when user navigates on different routes. I'm able to generate the page on the server and get the content…
1
vote
1 answer

Load fonts from node_modules in react-rails application with webpack

I have a react-rails application set up with webpacker. I am trying to load font-awesome-pro with it's fonts from node_modules. I assume this is a trivial task but I can't seem to find any good documentation on how to do this. This is what I have so…
Gerard Simpson
  • 2,026
  • 2
  • 30
  • 45
1
vote
3 answers

Calling onClick from within function

I am using react-rails gem and my code has the following structure. I am having difficulty calling onClick from a button generated from within a function. class AdminRevenueShareModelsSearch extends AlacrityTable { constructor(props) { …
user3385136
  • 513
  • 1
  • 7
  • 20
1
vote
1 answer
1
vote
1 answer

React on rails:Iterating through an array of activerecord

I am new to React with Rails and use of react-rails gem. I am trying to loop through all lifts and show the liftname through Lift component. The controller action index provides: class LiftsController < ApplicationController def index …
Saurav Prakash
  • 1,177
  • 1
  • 11
  • 25
1
vote
0 answers

Fullcalendar select works on double tap in mobile

I have used fullcalendar library with React on Rails. Currently on mobile devices the 'select' callback gets triggered on double tap. https://gist.github.com/RORingBBK/9d943068cee3e5ac1006d9ec936284c9 The select related options that I have used…
Code father
  • 585
  • 1
  • 11
  • 23
1
vote
1 answer

Save javascript image Croppie result to paperclip backend

I am using javascript image cropper (croppie) with react-rails. I've setup the croppie in react and it\s working fine. Here is my code. var el = $('.crop-area')[0]; var vanilla = new Croppie(el, { // enforceBoundary: false, viewport:…
Ahmad
  • 413
  • 5
  • 12
1
vote
1 answer

Attempting to change webpack-dev-server host

When trying to change the host in webpack-dev-server from 0.0.0.0 to localhost. I looked in the code (bin/web-pack-dev-server generated for Rails 5.1.3), tried to understand it, and noticed what I thought was a --host parameter PORT=8080…
1
vote
1 answer

react-rails: Uncaught ReferenceError: exports is not defined

I'm using the react-rails gem. Ive written a component SortableTable that I am trying to extend: In components/common/sortable_table.jsx class SortableTable extends React.Component { .. } It works fine in…
Deekor
  • 9,144
  • 16
  • 69
  • 121
1
vote
0 answers

Rendering a Navbar React Component in Rails App

I have a simple Rails 5 app with the react-rails gem installed. I want to create a Navbar that will appear at the top of every page in my app. I'm new to React, so normally what I would do is include an erb tag in application.html.erb that would…
1
vote
0 answers

Is it possible to use a React Component for one field of a Rails form?

I have a working Rails form in which I'm trying to implement one field as a React Component (as an input with autosuggester). I have the React autosuggester working perfectly (so I don't want to use a library for it), and now I'm trying to figure…
Ando
  • 165
  • 1
  • 14
1
vote
0 answers

React-Rails wrong number of arguments error

I have just started implementing react-rails to use react with our existing rails project. If I call render component: 'Table', props: { appt: "Hi" } in my rails controller, it works fine. If i call: render component: 'Table', props: { appt:…
Malinda Miller
  • 181
  • 2
  • 11
1
vote
1 answer

React not render div into li tag

Cannot render this code, get SyntaxError: [stdin]:4:1: unexpected indentation @Statement = React.createClass render: -> React.DOM.li React.DOM.div className: 'statement' @props.statement.body If i comment out that line…
nuT707
  • 1,543
  • 4
  • 17
  • 27
1
vote
0 answers

react-rails React.renderToString is not a function

We are using react-rails gem v1.10.0 to incorporate react in our rails app. The renderToString method is used in order to create a popover effect as such popover = React.createElement Popover, user: @props.user, avatar:…
stcho
  • 1,909
  • 3
  • 28
  • 45