![]() What it doesn’t have is any notion of server push or server ![]() Sessions is possible and will scale with existing web servers with Since this is all vanilla HTTP request/response, things like supporting With a form, the method from the form will be used. In most cases HTTP POST will be used, but if the element is associated You are free to use any DOM event and any server Both associate DOM clickĮvents to server side routes. In addition there are two data actions defined. Requests rather than to client side JavaScript. Live Elements is a StimulusĬontroller, just one that looks for actions and routes them to the server via In fact, it looks like we are usingĪ Stimulus controller, and that’s because we are. Let’s start with a modest Rails form, decorated with data attributes:Įverything here is standard Ruby on Rails. Running a bash or dash shell and get up and running in seconds. Shell script is provided which you can copy and paste into a terminal window While it is said that a picture is worth a thousand words, a demo can be priceless. Or you needing to write even a single line of JavaScript The difference here is that what we want is to associate DOM events to Turbo Streams deliver page changes over WebSocket, SSE or in response toįorm submissions using just HTML and a set of CRUD-like actions.Īctions, which connect controller methods to DOM events using data-action attributes Hotwire already has some awesome building blocks for us to use. There is really no need to start from scratch. Once this stabilizes we can move on to the next chunk. That both builds on what Rails already offers and does so in a way that will be LiveView supports, it does support a huge chunk of them. While what I am about to present doesn’t satisfy all the use cases that Phoenix
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |