词汇:it

pron. 它

相关场景

T:
It is my pleasure to meet you here.
>> Meeting the Guests at the Airport
The institute derives all its money from foreign investments.
该研究所的所有资金都来自外国投资。
>> 59-In or Out?
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're not gonna change that for this little example, but now let's check in that PWA files, and then let's deploy to production one more time. and as you can see, look in the top right corner, when I reload it, we now have that little install icon in Chrome. and if I click that little install icon, I'm gonna get this prompt, and boom! I have a PWA running in production for my Rails application.
>> Rails 8.0.1 You are in good company
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'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
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
Because we had not run our DB seeds! Now, I could run DB seed in production, but let me show you another way doing it .
>> Rails 8.0.1 You are in good company
All right , let's save that and hop back,and see a reload here, now, we have a sign out button, and we can sign out, and that's all it should be. let's deploy this to production, we're gonna just check this thing into Git, deploy it straight to production, go back to our alpha.software...Oops! That didn't work. Why did that not work?
>> Rails 8.0.1 You are in good company
So, it's no gonna show that button if we're not already authenticated, which is good because this layout is also used for login.
>> 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
And then, we are going to hop in here and have a look at what was actually generated. We have the sessions controller, that's probably the most important. You can see here, it allows unauthenticated access to just new and create.
>> Rails 8.0.1 You are in good company
But as you can see here, it adds a handful of migrations, one for users, and one for sessions! So, we're gonna run rails db:migrate again!
>> Rails 8.0.1 You are in good company
What it does not give you is a signup flow, because that's usually quite specific to a given application. So, we leave that as an exercise for the reader!
>> Rails 8.0.1 You are in good company
rails g authentication:
Now, let's add authentication to things as well. Authentication is one of the newer feature in Rails, it basically gives you a default setup for tracking sessions, tracking passwords, and even doing password resets.
>> 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
So in production, you actually need to manually specify the route. So we can go down here, and uncomment this, that sets what the route is going to be, we're just gonna point it to post stud index.
>> 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
And it will deploy it, push it out, do it in a red green deployment or blue green deployment such that there is no gap in that deployment as you set things up.
>> 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
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