In this video we're going to discuss ruby on rails version 7. Ruby on rail 7 came out
last month around the middle of December, towards the end of 2021. In this video we're going to
have a quick look at some of the new features that have been shipped as part of rail 7, and what that
means for us going forward with ruby on rails. So it's been quite some time since i covered any ruby
on rails videos but it's good to get back into this and have a look at some of the new features
are coming out and what it will mean for us going forward and if you enjoyed this video make sure to
give it a like and subscribe to the channel and i'm also taking recommendations i really want
to try and build some things in ruby on rail 7 to test it out so let me know in the comments if you
have any ideas of small applications i can build just to test this out and let you guys see it
and if you're interested in using ruby and rails for your own startup or your own business you can
use some of the templates that i have for sale on my website so you can visit the link in the
description below to check that out and i have a demo application for each of these and you can add
them to the cart just to purchase directly so they have finally updated the rubyinrails.org website
and i think that this is really overdue so they've updated the website and it talks a little bit
about the new version of ruby and rails we can see here from the top of the website that mentions
that the goal is to compress the complexity of modern web applications so i like the stance are
taken on this because modern web applications can get very complicated very quickly especially in
regards to the front-end technology that's used a common concern that i hear quite a lot in regards
to ruby and rails is that the scalability of it so as you grow your application will it scale
with the number of users that you have and it's good to see them address this so they say here
ruby andrews scales from hello world to ipo so ipo in this case meaning when you are filing as a
public company so by by that said you would expect that you have hundreds of thousands of customers
potentially or users on your website and if you have some time i recommend checking out this video
so the video here that is posted gives you a walkthrough of setting up a new rail 7 application
and it builds out a very simple blog that allows you to post comments and the comments are then
returned in real time so they are streamed in real time using hotwire.js so hotwire.js comes built
into ruby unreal 7. um going down the page here we can see a list of like really large companies
are using ruby on rails and this just goes to show that you know the scalability factor really isn't
an issue when you have such huge companies using ruby on rails so it's good to note that there are
a lot of big names that are still using ruby on rails so just scrolling down the page now
i think it's really interesting that they've updated this website and how they've modernized
it because um some of the videos i made before my youtube channel you were able to see how outdated
the ruby unrails website was and i think it just really uh confirms that they are still working on
this technology they haven't uh you know they're not uh retiring ruby and rails anytime soon so
they're actively working on it they're shipping new versions and they're building in new features
so we can see here that ruby and rails has a full stack framework they emphasize this part that is
full stack so this means that you can build the front end of the application the back end
and anything in between you can use it to build apis you can use it to
uh you know you can use it to build practically anything that you may need
which is really really helpful if you are trying to use a tool like this to build things quickly
if you want to use an all-in-one tool to build things quickly then ruby and rails is a good
choice for that and i give some examples here such as rendering html templates updating databases
sending receiving emails live pages via websockets and queueing jobs for asynchronous work storing
uploads in the cloud and etc etc so there's a lot of things that ruby and rails can be used
to do so directly underneath this we have some code examples of controllers models
views and routes so just to give you an idea of the file structure and where things go within the
application and directly underneath this and we have a mention of ruby and rails being optimized
for happiness so ruby is the underlying language behind ruby and rails and if you're a follower
of my channel you'll probably know this by now but ruby is designed for developer developer happiness
i think that's how we used to describe it anyway so the idea being that you can write code that
is very clean very lightweight but you can achieve very large amounts of functionality without having
to write very large amounts or verbose amounts of code so it is developer friendly and this is
why i've been using it for so long because it is very nice to write code in ruby so at the bottom
of the page they mention here about hot wire now hot wire was introduced i believe in ruby and
rails version 6 and i haven't done too much with it but from my understanding it is a replacement
for something like action cable so you can return data stream data back to the browser in real time
a great example of that would be that if you have a blog post and someone writes a comment on that
blog post then it will also push that comment to all of the browsers that have that page open
so anyone who's on the website already on that page will automatically see
that comment appearing in real time so it's very nice to be able to get real-time data
within your application and they use hotwire to do this so this seems to be the future direction um
that ruby on rails is going in so hotwire seems to be the choice for doing streaming
of data like that um we'll have a quick look here um i'm gonna have a quick look here at
the post about the new version of ruby rail seven so i'm not gonna do any coding in this video i'm
just basically going over everything that has been released some of the information has been released
and then in some of the upcoming videos i will do coding examples of using ruby on real seven
i'm not going to go through this in too much detail but i'll point out a couple of things that
stood out for me um one of them is the separation or the uh removal of node.js on the front end so
this is quite interesting because the front end in ruby unreal 6 was very very complex in my opinion
and i've had numerous people reach out to me trying to figure out how to upgrade their
applications from versions five to six and that basically the problems all seem to be around
the javascript um so how that's compiled on the front end or how it's bundled and the dependency
management that comes with that so there are a lot of struggles i've had with webpack on
rail six and i think anything to kind of change that direction is a good thing in my opinion
so hot wire is going to come as part of the default that will be built into rail 7 so that
uses turbo and stimulus and it will make the front end experience much faster much more pleasant to
use and from what i've seen it's quite easy to set this up you know you just have to include a
couple of lines of code and you've got real time streaming of you know data from your applications
will push updates to all of the browsers are on a specific page so for example i mentioned earlier
about the comment on the blog post so that's a very simple example of how that would work
you will see real-time updates of data in the application um there's also a mention here about
decoupling of the javascript bundler so you don't have to use webpack anymore
so i think it's going to be quite interesting to see what people move to if they decide to do that
there are different css frameworks here being mentioned so you can install some
of these by default from what i understand so tailwind bootstrap and various other ones
so there's something down here i found quite interesting um there are a bunch of things
here i won't cover them all but one of the things here is about encrypted attributes
for activerecord now previously they did that with passwords and i think maybe authentication tokens
but now they are doing that with everything it seems like all of the data in the database
um so i'll need to explore that a little bit more to find out how that exactly works
um another cool thing i found here was the load async so load async means that we can speed up
the queries when loading a page so if you had to run various different uh select you know
queries against the database maybe you're loading users you're loading their posts
you're loading something else um previously you'd had to do those uh one after each other
so that would get quite slow if you have a lot of queries
being loaded against the database but now you can do this asynchronously so you can
continue loading the page while these queries queries are being handled against the database
i think that's mostly what i'm gonna cover in this video um we'll go into this a bit more
detail once we start building an application but i just want to cover this very briefly
because it is very interesting that they have launched this new version of ruby and rails
and it just shows to me that the future of ruby and rails is very good right now
so there are a lot of things happening new features being added and new versions being
released it just gives me a lot of confidence that using ruby on rails is a good choice still
in 2022 let me know your thoughts in the comments below and if you enjoyed this video
make sure to give it a like and subscribe and i will see you guys in the next one