词汇:have
vt. 有;让;从事;允许;拿
相关场景
- Now you have access to your entire domain model. So if we find the first post that we created, we can update that post straight here from the console, if we hop back, you see, title is now changed from CLI. New command line interface ( CLI)>> Rails 8.0.1 You are in good company
- And you can help diagnose whatever issue that it is that you have ! But let's remove that again and then let's look at the console from another angle. Now, you can get the console as I just showed you when an exception raised, but you can also get the console if you just run rails console.>> Rails 8.0.1 You are in good company
- console instance variables:
- Now, let me show you one of the first feature here. If we do raise exception inside the index action, "rails 'some exception' " you will see that Rails provides some really nice interface for dealing with that exception, seeing exactly where it happened. If I'm reloading here, you can see the line, it was raised on the source code that's around it, you can see a full trace. And down here, we even have a console! So, you can interact with the instance variables that have been set for this index actions, here's just at posts that's been made available.>> Rails 8.0.1 You are in good company
- Now , Rails has a bunch of different ways you can do the CSS, there's also a path where you can use Tailwind. Lots of people like that for good reason, and there are a bunch of different options, all the major CSS frameworks are available, but by default, we ship with a no build, as I said, intention and simple CSS just make things look prettier without having to adorn anything with classes, or what have you.>> Rails 8.0.1 You are in good company
- compile:
- By default, I like to use simple CSS. https://cdn.simplecss.org/simple.css. It is simply a individual file that's being included, I don't have to compile anything here, I'm just referencing it straight off their CDN. And if we save that and reload, you can see it just looks a little nicer.>> Rails 8.0.1 You are in good company
- variant:
- But oh yeah! Let's show you real quick here,if you do a /post.json, you're gonna get that automatic API as well, as I showed you in the controller, there are two different paths, you have HTML, and you have JSON. You could also have added XML in there or another path, but by default, you just get these two different variants, the HTML and the JSON variant.>> Rails 8.0.1 You are in good company
- This is the thing you're gonna see, when you start up a new Rails application, it'll tell you which version you're on, both for the ruby version, the Rails version, and the Rack version. That's running on localhost:3000 by default. But if we do slash posts here, you'll see the scaffold interface that we generated. Now, this is the index action, the one we just looked at in the view and from the controller. But if we click the New, you see here we have form for creating the new post with its title and its body. it's quiet basic, to put it mildly right now, but all the actions are mapped out. This scaffold interface is not meant for shipping into production, it is meant to showing you how to build a Rails application with the basics, and then you make it look pretty, you make it look nice.>> Rails 8.0.1 You are in good company
- And then finally, we have the views that are being generated. If we hop in here and have a look at the index view, you can see this is where we will list all the posts that are in the system.>> Rails 8.0.1 You are in good company
- And as it descends from application record, we can run everything from updates and destroys and what have you. This is also where we're gonna put our specific logic that's particular to this application beyond just the management of attributes.>> Rails 8.0.1 You are in good company
- find it straight off an ID:
- And if you scroll down here, you can see we have everything served in two flavors, we have both the HTML setup that'll render views directly, and then you have JSON that'll render for and an API. And as you can see here, we're also setting up a new post for some of those actions that require that, we're gonna find it straight off an ID passed in through the URL, and the post parameters are the ones we're using when we're creating and updating the application.>> Rails 8.0.1 You are in good company
- All post controllers follow the same convention. There are seven actions, you have index,show, new, edit, create and update and destroy! So there form a basic setup for configuring everything that's needed for a resource to be exposed to the web.>> Rails 8.0.1 You are in good company
- So, let's jump into the post controller first. The controller is really what guides all the inbound actions you get into a Rails application, you'll have the user hitting (slash)/posts or /post/new, and it gets routed into the posts controller!>> Rails 8.0.1 You are in good company
- That post is just going to have a title that's string and a body that's a text, and as you can see here from what's being generated, we have everything that we need to set up a basic interface for that scaffold. There is a migration that'll set things up in the database. There is a controller, there are views, there's a model, there's even testing stubs and adjacent API on top. So let's run that migration, and as you can see here, we created the posts in the main schema file, and now, we're ready to have a look at the application that was generated here with the post scaffold.>> Rails 8.0.1 You are in good company
- Leijun:
- All the setbacks and failures you have experienced, even those seemingly meaningless things that waste time, will become your most important and precious wealth.>> Motivate yourself in the morning
- every morning we have two options "get up and chase your dreams or go back to bed to see your dreams" never forget this .>> 4 Minutes To Start Your Day Right! MORNING MOTIVATION and Positivity!
- When you listen to tapes, listen with relaxed belief, believing that this can happen for you. And by listening to them, listen to them over and over and over again. And you will get a breakthrough, you can listen to the same tape for months and all of a sudden you hear something you never heard before, and have a special meaning for you. Or you can read the same book over again and you'll find some special insight, you said I can't believe I didn't see that the first time.>> Motivate yourself in the morning
- One of the things that we must do is that we must be involved in working on achieving self mastery. You must work on yourself continuously. Never be satisfied with yourself, always know that as you invest the effort and time on you.That's the greatest ability that human beings have above animals.>> Motivate yourself in the morning
- this has not been easy 现在完成时(Present perfect)过去发生并且已经完成的动作对现在造成影响或后果,过去某一时间开始并一直持续到现在并且有可能还会持续的动作或状态。 翻译为这一直都不容易,比如说我国的复兴之路从开始到现在都不容易 this is not easy 翻译为不容易,比如说成功不容易,是过去,现在,将来都不容易>> 52-A Pretty Carpet
- a strict curfew has been imposed from dusk till dawn.>> 51-Reward for Virtue
- Didn't you have a crash?>> A Car Crash
- They have to do that , it's part of their life. If you mess that up you know. It makes everything else particularly hard. So and I heard a great speech from a woman once, who said you can have it all, you just can have it all at the same time.>> work hard but work smart
- You don't have to answer everything all at once. You know I tell all people Jade Morgan. Everyone should take your on their own, their mind, their body, their spirit, their soul, their family, their health.>> work hard but work smart
- Have a thought process around things that are complicated and you'll get better over life.
围绕复杂的事情进行思考,你会在生活中变得更好。>> work hard but work smart- You know you get your thoughts together, have a process in place for decision making. Don't allow yourself to become weaponized. Like at all you know or and don't have it to extend I have a temper. It works against you. You always have to end up apologizing.>> work hard but work smart
- There is a great quote, "I'm sorry I wrote you such a long letter. I didn't have time to write a short one." That's respect to people.>> work hard but work smart