Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Cutting-edge web interfaces surprise and delight users with their interactivity. Can we somehow enable this next-generation user experience with our current rails templates and not rewriting our presentation layer in JavaScript? Sync enables your rails partials to update on the client in real time. It can match the user experience of JavaScript MVC frameworks. This session will explain how Sync works and how to integrate Sync in an existing application. Prepare to have your mind blown. Mike Moore believes software is written for humans first and computers second. He is a living breathing person with many quirks and interests. Help us caption & translate this video! http://amara.org/v/FG0S/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
# Summary of 'Real-time Rails with Sync' In his session at RailsConf 2014, Mike Moore discusses the implementation of real-time features in Rails applications using the Sync library. The goal of this session is to demonstrate how developers can enhance the interactivity of their applications without completely transitioning to JavaScript frameworks. ### Key Points: - **Introduction to Sync:** - Sync is a lightweight Rails engine designed to allow Rails partials to update in real-time on the client-side, mimicking the behavior of JavaScript MVC frameworks. - Developed by Chris McCord, it allows real-time client-server communication without the necessity to rewrite the front-end. - **Sample Application Setup:** - Mike presents a simple CRUD application highlighting posts and comments. He emphasizes that design is not a focus during the demonstration to keep the coding process straightforward. - Sync is integrated by adding the necessary gems (Faye, Thin, and Sync) to the Gemfile and setting up the backend to facilitate WebSocket connections. - **Real-time Features Implementation:** - By adding specific Sync methods for models and controllers (e.g., `sync_all`, `sync_new`), real-time commenting functionality is introduced. When a comment is added or deleted in one browser instance, it is reflected across other connected browsers. - Mike demonstrates live coding where he modifies the comment model and controller to enable real-time updates, illustrating how quick and efficient Sync can be for achieving live updates. - **Synchronizing Different Resources:** - Mike works on scoping comments within specific posts and demonstrates how to control what updates in real-time by using scopes within the model, such as `by_post`. - He also discusses the implications of enabling sync for other resources, like posts, emphasizing the need for careful management of what gets rendered to avoid inconsistencies. - **Limitations and Considerations:** - The session highlights some caveats, such as the difficulty in managing user permissions in templates that are sent to all clients. Careful consideration and conditional logic must be applied to ensure appropriate editing rights. - Mike concludes by emphasizing the importance of server-rendered HTML and the advantages it offers, discussing the risk of developers moving away from Rails for real-time features if not addressed effectively. ### Conclusions and Takeaways: - Sync allows significant improvements in interactivity for Rails applications without a complete architectural overhaul. - Real-time capabilities can be integrated efficiently into existing Rails applications, preserving the strengths of server-side rendering. - It's crucial for developers to rethink traditional Rails approaches to maintain competitive applications in the evolving tech landscape.
Suggest modifications
Cancel