Adding Our First Component
Letâs take a second and talk about what we are going to use React to do. The concert display page was quietly part of our original Rails app, but we havenât looked at it closely yet. It currently has a grid of seats that weâd like to use to allow people to select what seat they want to purchase at the particular concert being displayed.
Right now, itâs a grid of squares in an HTML table:
â | <table class=â"table"â> |
â | <tbody> |
â | â<%â @concert.âvenueâ.ârowsâ.âtimesâ âdoâ |row| â%>â |
â | <tr> |
â | â<%â @concert.âvenueâ.âseats_per_rowâ.âtimesâ âdoâ |seat| â%>â |
â | â<%â ticket = @concert.âfind_ticket_at ... |
Get Modern Front-End Development for Rails, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.