词汇:as
conj. 因为;依照;当…时;随着;虽然
相关场景
- Meet a guest at the lobby of the airport.>> Meeting the Guests at the Airport
- The FIRE movement (financial independence, retire early) preaches the value of aggressive saving and prudent investing. Many people who adhere to FIRE principals don't even plan to retire early—but they do want the ability to make choices without being tethered to a traditional day job.
FIRE运动(财务独立、提前退休)宣扬积极储蓄和谨慎投资的价值。许多遵守FIRE原则的人甚至不打算提前退休,但他们确实希望能够在不受传统日常工作束缚的情况下做出选择。>> FIRE生活- What should a tour guide do if the flight of the tour group is delayed?>> Meeting the Guests at the Airport
- what kind of preparation if necessary for a tour guide before he goes to the airport to meet an overseas tour group?>> Meeting the Guests at the Airport
- 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'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
- 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, 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
- 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
- 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
- As we edit a new dependency, we can hop back in ,reload, and now we're good to go here. as you can see, I first tried to put in a wrong password, we're gonna get this screen, try another email address or password.>> 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 do the authentication using the email address and passwords, and start a new session from there.>> 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
- 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
- Common system is of course these as well, let's add one of those comments, and now we have the entire application running in production, wasn't that easy?>> Rails 8.0.1 You are in good company
- By default, Kamal will use a docker volume to start these things up, but of course, you can configure that, and as I said, you can use S3 if you'd like as well.>> 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