词汇:scaffold
n. 脚手架;绞刑台;鹰架
相关场景
- Alright! Now let's add some comments to our blogging system! And I'm gonna use a different generator here,I'm gonna use a resource generator that is a little lighter than the one we were using for scaffold that doesn't generate a bunch of views, and doesn't generate all sorts of actions in the controller by default, but it does generate the new model that we need the comment model, it generates a migration for that, create comments ,and it generates just some empty placeholders for the comments controller and for the view action.>> Rails 8.0.1 You are in good company
- But now that we've add that, let's have a look at our application JS file.That's the default setup that you have that the scaffold is going to use. And as you can see, we're using turbo-rails, we're including all the stimulus controllers, if we have any.>> Rails 8.0.1 You are in good company
- Now if we hop back into our editor here, I can add a little bit of styling to make this look slightly nicer than the very basic layout that you get with the scaffold.>> 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
- 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
- We're gonna start by running 'rails new blog' to get the basic Rails skeleton, let's hop into that skeleton, and then we're gonna generate a scaffold for a post.>> Rails 8.0.1 You are in good company
- Later:
- Szpilman, on top of a free-standing scaffold, Benek and the others demolishing a ghetto wall, wielding skdgehammers.>> 钢琴家 The Pianist Movie Script