N
N
NO2018-04-25 18:29:32
Ruby on Rails
NO, 2018-04-25 18:29:32

How to use ReactJS if the application is on RoR?

There is a Ruby on Rails application, front-end on Bootstrap + jQuery, respectively.
Due to def. difficulties, I want to rewrite the front in ReactJS.
Question:
There is a "div" block, it contains a list of links / products, it is necessary for search robots to index it (i.e. rendering is done on the back-end). I want to access it using React and manipulate it. For example: onSubmit, onChange, etc., how can I do this?
In jQuery, I do something along the lines of:

$('div form').submit( function ( event ) {
    event.preventDefault();
    do_something();
});

Is this possible in React? If so, how?
Or do you need to "prepare" blocks on the back-end in order to "pick up" them on the front-end?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-04-25
@rockon404

Are you sure you even need React? If yes, then either rewrite the entire server side rendering on React, for this you will need an additional node.js server, or implement on React only modules with complex logic that do not need indexing: shopping cart, personal account, checkout, admin panel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question