词汇:with
prep. 用;支持;随着;和…在一起
相关场景
- You should get familiar with your group.>> Making preparations 1-11
- And it's gonna refer to an icon, by default,we just have a nice red dot.but you should obviously replace that with your application. And if I hop in and have a look at the service worker, it is sort of already set up for doing we push,just as an example here, having some listeners, you can tweak that as you see fit.
它将指向一个图标,默认情况下,我们只有一个漂亮的红点。但你显然应该用你的应用程序替换它。如果我跳进去看看服务工作者,它已经为我们推送做了准备,就像这里的一个例子,有一些监听器,你可以根据需要进行调整。>> Rails 8.0.1 You are in good company- we are in with production authentication for the entire system. all right one last thing, let me show how to turn this web application into a PWA as well.>> Rails 8.0.1 You are in good company
- SO now, we're created that user in production using our Kamal consol! I can log in with that user/pasword.>> 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
- Now, let's add a way to sign out to the main layout here. we can add that with a button to sign out.it's gonna hit the session path, and it's gonna use a method of delete that session if we're authenticated, as you can see there.>> Rails 8.0.1 You are in good company
- Now, if we hop back onto local host, and we try to log in with first the wrong password. we're actually gonna see something here , when I added the authentication, it added another gem, it added bcrypt, that's what we're using to keep password secure, so we have to hop back in here and restart our development server!>> Rails 8.0.1 You are in good company
- If we hop to the session, you can see it just is very basic Rails active record. Now we're gonna set up a default user that the systems should have as we're working with it to allow us to log in since we don't have that signup flow.>> Rails 8.0.1 You are in good company
- Everything else by default will be behind the authentication lock! There's also a rate limit to make sure that people don't bombard you with attempts to log into users do not have access to.>> Rails 8.0.1 You are in good company
- If we go back here and reload not in production, boom! We are live in production with our whole setup, everything is working, we can upload the active storage files directly to it.>> Rails 8.0.1 You are in good company
- There was a 404 here! That's because if we go back to out route file, I have not defined route! And in production, you're not gonna get that screen we saw with the Rails version and the Ruby version, that is only for development.>> Rails 8.0.1 You are in good company
- And that'll connect to the remote server, and it'll install Docker if it's missing,it'll build the Docker file or Docker container off the Docker file that Rails ship with by default, there's nothing you need to set up there.
这将连接到远程服务器,如果缺少Docker,它将安装Docker,它会根据Rails默认附带的Docker文件构建Docker文件或Docker容器,你不需要在那里设置任何东西。>> Rails 8.0.1 You are in good company- You'll need to change that if you're working with other people of course, because you don't wanna check that master key into your Git repository,you're gonna wanna pull that out of one password when you go for real.>> 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
- And you can pull that password from a bunch of different places, you can pull it from a credential store like one password, you can pull it straight out of Github command, as you can see here with the Github token above, or you can pull things out of ENV.>> Rails 8.0.1 You are in good company
- The attacker was the same person who planted the explosives in those ice coolers in two nearby locations in the French Quarter just a few hours before he rammed into the crowd with his vehicle.
袭击者就是在法国区附近两个地点的冰冷却器中放置爆炸物的同一个人,就在几个小时后,他驾驶车辆撞向人群。>> 56-Faster Than Sound!- Marrying somebody to change them is crazy, and I would say hiring somebody to change them is just as crazy. And becoming partners with them to change them is crazy.>> we make silk purses out of silk
- We tried it with the predictable results and life is so much more fun this way too. I mean, who wants to spend their life trying to change people from their natural...>> we make silk purses out of silk
- A lot of people like to buy good companies with bad managers and then replace them.>> we make silk purses out of silk
- 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
- 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
- It'll automatically know that the comment model should map to view slash comment slash comment, so it can look up the right partial file to use. And then below that, we have the form that we're referencing with the comments new. So, let's hop in and paste in the individual comment. As you can see here, we just give it a div, that has a dom ID so that we can reference it.>> Rails 8.0.1 You are in good company
- So let's actually also create the other direction of this association. You saw a comment belongs to a post, but then we're also gonna make the post has many comments. Now, we have a bidirectional association that we can work with in both ways.>> 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
- stick with us and you'll keep learning.>> 52-A Pretty Carpet