RailsConf 2015 - React.js on Rails

Confreaks · 25K views · 2015 · 31:24

Open on YouTube

Web developmentSoftware architecture & designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it as the walkthrough they follow when wiring React components into a Rails app, and cite it when their code from the talk breaks.

Recommended by 2 people across 2 different months, 2015 to 2016.

What it is

A RailsConf 2015 talk by Michael Chan on using React.js inside Rails apps. It covers the history of Rails and JavaScript, how React and Rails complement each other, and the pain points of JSX, CoffeeScript and NPM integration, with a live-coded example.

What people said

Recommends Badr Tazi · 2015-11 · Stack Overflow · on “How to access children components props with react-rails”

I have watched this talk [this video] and I am right now trying to use react components to show a list of messages (in a chat). So I have two react components: 1) The "Message" component that is basicaly an li with the message props (dateTime, userName, and body); var Message = React.createClass({ render: function () { return ( <li className="right clearfix"> <span className="chat-img pull-right"> <div className="chat-body clearfix"> <div className="header"> <small className=" text-muted"> sent {this.props.dateTime} </small> <strong className="primary-font">{this.props.userName</strong> </div> <p>{this.props.body}</p> </div> </li> ); } }); 2) The "Messages" component which is a ul that lists all

Recommends Bevilacqua · 2016-08 · Stack Overflow · on “React.js on Rails error”

I am following this [this video] tutorial on how to integrate react.js into rails and when I pre compile my assets I get an error with this code stating that (data) => this.setState({statuses: data}); causes SyntaxError: unknown: Unexpected token (14:44) I tried many things to get it to work and when I delete the semi-colon at the end it works except that the interval no longer gets called the console will say alert twice when the page is refreshed and then never again. var StatusesContainer = React.createClass ({ componentWillMount() { this.fetchStatuses(); setInterval(this.fetchStatuses(), 1000); }, fetchStatuses() { console.log("alert"); $.getJSON( this.props.statusesPath, { space_id: this.pro

Cites Swaathi Kakarla · 2015-08 · Stack Overflow · on “React JS with Rails - Accessing JSON data with URL”

I'm learning how to use React JS with my Rails app. Disclaimer: This is the first time I am messing around with JS! I'm following a talk by Michael Chan at Rails Conf [this video] . Everything works beautifully until I hit the CommentsContainer part, where he fetches the comments data from a Rails route. I am trying to the same thing, except on a simple Songs controller (generated with a scaffold, having name and artist as the attribute). I am getting stuck at the part where he fetches this data with the path, I end up with a 500 error page when I try to run the code. I don't know how to debug my React code, since the browser console is just showing a 500 error. Here's my view, <%= react_componen

Cites SJU · 2015-10 · Stack Overflow · on “Ruby on Rails separate front & back”

I've been using Ruby on Rails since a little more than one year now and I've always do it in a casual way, I mean, everything in one place (front & back), using the standard .html.erb file populated by the associated controller method. Otherwise, today in our project, I have the need to separate the front and the back end for multiples reasons (code maintainability / clarity, better architecture, more reactivity, etc...). I've done plenty of researches [LINK] , watch some conferences ( 1 [LINK] , 2 [LINK] , 3 [this video] ), but didn't find my solution yet. It looks like to be a question that comes often, but what is the best practice/tools to separate the backend and the frontend of a Ruby on Ra