词汇:on
adv. 向前地;继续着;作用中,行动中
相关场景
- So that is a very quick tour of Rails, this is a wonderful way of getting started,just to use those scaffold generators and the authentication generators to get something going, get a Hello world out there, start working on your application, and before you know it, you might just be taking your application all the way from Hello World to IPO.
这是Rails的快速浏览,这是一种很好的入门方式,只需使用这些脚手架生成器和身份验证生成器即可开始工作,创建一个Hello world,开始开发你的应用程序,不知不觉中,你可能会把你的应用程序从Hello world一直带到IPO。>> Rails 8.0.1 You are in good company- We'll turn those on and I'll show you the manifest first. The manifest is just really basic. It's gonna show the name of the PWA you're gonna using!>> Rails 8.0.1 You are in good company
- We're gonna turn the manifest on in our route file as well. There are basically two lines here as you can see, there's a manifest, and there's a service worker that you can use for your PWA.>> Rails 8.0.1 You are in good company
- we're gonna create a link reference here to manifest just exists here as a comment that you can reference. We're gonna turn the manifest on in our route file as well.>> Rails 8.0.1 You are in good company
- So, be careful when you create things, that are gonna be created on the server side in your real database.The database, by the way? we haven't talked much about that, and that is because we're using SQLite. So, there is nothing to configure,there's nothing to set up, SQLite is now a suitable database for production with Rails. we have tuned it with all the right pragmas,to run SQLite well in production, you of course still need to set up a way to back that up, but everything else is preconfigured for you.>> Rails 8.0.1 You are in good company
- Kamal console:
- Kamal also gives you a way to start a console on the server side that is just like the console I showed you earlier that ran in development! You can see here, it reminds you that you are in production.>> Rails 8.0.1 You are in good company
- And that's basically the rhythm you will be in when you're working on a Rails and application and you're deploying to production.>> Rails 8.0.1 You are in good company
- And as you can see here, I sped things up a little bit, but it was about 80 seconds on my linux machine from a cold boot to do that.>> Rails 8.0.1 You are in good company
- I'm pulling it out of ENV with my Kamal registry password that I've already set up on my personal bash. And then, the Rails master key that does the decoding of any credentials we've set for Rails, it's just using a cat straight out of config master key.>> Rails 8.0.1 You are in good company
- Many of the cars broke down on the course.>> 56-Faster Than Sound!
- 21:28:
- So this server exists on this address, servers web: - demo.exitsoftware.io ; proxy: host: alpha.exitsoftware.io; And I will then fill out the host as a C name to that machine. But we're using Alpha here, if I had deployed another application called Bravo to the same server, Kamal would set it up, so it's like I host two applications or any number of applications on that same server! Now, we will also need to have a look at the secrets here, that is in dockyml/secrets, because the register that I'm using, that is Docker Hub, needs of course a password, it is using my username but also needs a password.>> Rails 8.0.1 You are in good company
- Now I'm gonna deploy this on my own little hoppy server. And that hoppy server is currently wiped. it is completely clean, and Ubuntu 24.04 setup that has nothing on it already, this is part of the magic of Kamal, you can spin up a new VM anywhere in the cloud or use your own hardware and point Kamal straight to it, and you'll be going in no time!>> Rails 8.0.1 You are in good company
- Docker Hub:
- And there's a default configuration file in config/deploy.yml that we can use, it's prefilled a little bit, it has the service name of the name of reaction, but we need to rename, for example, your user,the name of the image to go to my name of where I store this on Docker Hub. You can see we change that down in the registry as well and the name of the container image.>> Rails 8.0.1 You are in good company
- Kamal:
- All right, that is very neat. Now, let's go to production! Because of course, you're not just here to create a Hello World app that runs on your own machine, you want to get this out into the world! And rails8 and forward ships with Kamal, a simple tool for deploying your web application anywhere.>> Rails 8.0.1 You are in good company
- And that is basically it. Now if I go over here and I add a comment to one of these, you see the comment was added on the left immediately at the same time. That's all web sockets automatically happening through action cable. And we can do it , of course the other way as well.>> Rails 8.0.1 You are in good company
- And if we hop into our comment, we can set up a broadcast_to for that post. The broadcast_to will broadcast all update made to that comment, whether a new comment is updated or an existing comment is changed in some way or even one deleted, and send it back out to a channel on action cable named after the post association that this comment belongs to!>> Rails 8.0.1 You are in good company
- When it is nested, we get the fact that it's gonna be slash post slash on slash comments, and we have the association is set up nicely. Now, let's reload! Now it works, we have our comments field underneath. we can add the first comment. And as you can see here, this is my first comment a second ago that was the local time doing its time ago conversion.
当它被嵌套时,我们得到的事实是,它将是斜线后斜线对斜线注释,并且我们已经很好地建立了关联。现在,让我们重新加载!现在它工作了,我们在下面有我们的评论字段。我们可以添加第一条评论。正如你在这里看到的,这是我一秒钟前的第一条评论,当时当地时间正在进行时间转换。>> Rails 8.0.1 You are in good company- We are pacing in the comment, and we're using that same time tag as we were using with the post, but this time, we are going to use time ago, so we get that nice two minutes ago on when something went posted rather than a local time spelled out with AM PM set up.>> Rails 8.0.1 You are in good company
- The comments is something that belongs to a post, and we will pull out the post ID from the params, that's what's being parsed in as part of the URL, and we will fetch that post, and now we will create the comments associated with that post based on the parameters that are expected as comment content. And then after it's created, we will direct back to the post!>> Rails 8.0.1 You are in good company
- If you look at something like hey.com, you'll see this technique in use on a major application, and you can view all of the Javascript that we use to build that application, and that's the default for Rails.>> Rails 8.0.1 You are in good company
- We're G sipping or Brotliing this stuff so that it transports really quickly, but we're allowing you to view source on an entire application.>> Rails 8.0.1 You are in good company
- He has temporarily put his books on the floor. They won't be there long.>> 52-A Pretty Carpet
- inspector:
- But really, what's unique here for Rails is the fact that we're using no build by default! So if I go over here in the inspector and look at the JavaScript files that are included,you can see we have the application js file with a little digest stamp on there. If we change anything that application js file, the digest is going to change, and the browser will redownload just the part!>> Rails 8.0.1 You are in good company
- So, we can do that using the import map pin command. And as you see, now that I hop back into our config import map, we've added the local text pin at the bottom, version 3.0.2. It pulled that straight off NPN, it downloaded that as a vendor dependency that we can check into our version control system. And now, we don't have any runtime dependency whatsoever on NPN, or anything else like that.>> Rails 8.0.1 You are in good company
- As you can see here, there is now a full WYSIWYG interface for creating the body. It comes with a default set of styles for the toolbar, you can change those, those styles are generated straight into your application, so you can make it look nice for yourself. Let's give some bold and italic text here, you see, that was all that was needed. but I think what's even nicer to look at here is if we do an upload and we add a file, you will see that file gets added with a preview directly to the WYSIWYG editor. And if we save that and we update the post, it is added to the post itself. And that then went through the whole process of doing a direct upload of the file when we dropped it into the editor, that uploads it straight to active storage. And then, we have access to that, and rendering it directly from whatever storage backend active storage is using. In this example , we're just storing on disk, but you could be storing your active storage in S3 or another object storage.>> Rails 8.0.1 You are in good company