Railscasts by Ryan Bates - My Notes
I hope to go through one of these videos everyday, so I am aware of the tools that are out there in the Rails World. A very very brief synopsis will be provided. I make no claims as to the accuracy of what is contained here, nor its completeness. They are merely personal notes which happen to be published. Let’s see how long we can keep this up for!
https://www.youtube.com/watch?v=Gh8F6OJa0gU - Summary: (i) How do you handle situations where you need to many changes to many resources: typically you would have to make many requests. This is time consuming, and cumbersome. Perhaps you can do everything in a single request? Secondly, this episode also considers situations where the user is offline - and when they go online, those requests are sent. Lastly, the implementation is handled via Rack Middleware. This is somewhat educational in that you are made a little bit more aware of how the rails framework is doing its magic. I would say that the problem domain in this area is solved by GraphQL, which I feel will be the default standard very soon, to minimise over and under fetching of resources. There are likely many ruby or rails implementations of this. Secondly, there seems to be a lot of client side scripting which needs to handle situations where the requests fail (when users are offline). There will likely be solutions to this problem, from a GraphQL point of view, when implemented in Rails
https://www.youtube.com/watch?v=XrpcuRCaAuA - How you can customise the JSON output your rails app generates (easily). Also consider #320 and #322 where https://www.youtube.com/watch?v=2QybiyDX_u8 and Rabl are considered.
https://www.youtube.com/watch?v=9w7uGTmT8VE - Discuss strategies by which you can ensure that when deploying your app (i.e. upgrading it from an old version) that it can appear relatively seamless from a user’s point of view. Also makes note of what happens when you are making a database change: (i) if a user has brought up an old form (from the old app) and submits then, when there has been a change in the form’s fields - then errors might come up.
https://www.youtube.com/watch?v=pgWWUrI9ZCs - How to set up your VPS from scratch to deploy your rails app. It’s one thing to write a rails app on your local development machine. It is quite another to deploy it. The easy way would be to use Heroku. But then you get very little choice. Or on the other hand, you could have all the choice in the world: but then you would have to do a lot of work to get it up and running. Surely, there are solutions out there which allow for customisation, but with standard configurations? Apparently, handling concurrency on Heroku can get very expensive, as you will need to have separate processes for this (read dynos). As with all things, the devil is in the details. Deploying efficiently, and cheaply is something which requires a fair degree of expertise.
https://www.youtube.com/watch?v=L0RqU2MdqXU - Explanation of how to use MongoDB with your rails application. To do: must investigate further into the differences beteween the various NoSQL databases out there: graph based, document based, column based and key value pair based, as well as the problems they attempt to redress.
https://www.youtube.com/watch?v=AoGPaWEasxs - Shows how you can move tasks into the background without holding up your rails app. Delayed job is a specific gem to handle this. There are others too. ActiveJob abstracts away, the need to rely on a specific implementation, so is very good in that regard.
Go Rails
- Params Hash
- Basically routes params and query parameters, as well as post request parameters are pulled off and dumped in the Rails params hash.
- Annotate Gem
- This basically annotates your database columns in your model files, so you can easily see what’s going on without having to switch back and forth.