词汇:action

n. 行动;活动;功能;情节;战斗

相关场景

Confidence at the heart of confidence is action.
>> Confidence is action
And that is basically it. Now if I go over here and I add a comment to one of these, you see the comment was added on the left immediately at the same time. That's all web sockets automatically happening through action cable. And we can do it , of course the other way as well.
>> Rails 8.0.1 You are in good company
And if we hop into our comment, we can set up a broadcast_to for that post. The broadcast_to will broadcast all update made to that comment, whether a new comment is updated or an existing comment is changed in some way or even one deleted, and send it back out to a channel on action cable named after the post association that this comment belongs to!
>> Rails 8.0.1 You are in good company
Now, let's set things up to be dynamic, such that when we add a new comment to one of these, it's going to update the other as well. This is how we use web sockets in Rails using action cable, one of the frameworks that we have to create updates that are distributed automatically without folks having to reload their browser.
>> Rails 8.0.1 You are in good company
Now that we have that up, we can hop in and look it all up into the show action for the posts! That's gonna reference that common slot comments, that includes both the comments and the new form.
>> Rails 8.0.1 You are in good company
Alright, if we hop into that comments controller, it was empty. As you can see there, I'm gonna pay something in that actually makes this stuff work! You'll see one principle of the controller setup we have is that we have these callbacks. Before action, we're gonna set posts. So before all the actions, we're going to reflect the fact that this is nested resource.
>> Rails 8.0.1 You are in good company
So, let's run the migration for that, that sets up the comments table. You can see here the schema that we've now built up. We've added a number of tables for action text and action storage. And then, we have added a comments table. That's what you can see here. As we had it in the migration where we were just referencing the post as a foreign key, and then we had the content as text.
>> Rails 8.0.1 You are in good company
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
We're including trix and action text to give the WYSIWYG, and now we're gonna add that local text package as well. "import LocalTime from 'local-time' LocalTime.start()"
>> 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
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
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
Soon we will put my excellent plan to action.
>> Madagascar (2005)Movie Script
On top of the trifecta of Solid adapters that makes it possible for SQLite to power Action Cable, Rails.cache, and Active Job, a bunch of work has gone into making the SQLite adapter and Ruby driver suitable for real production use in Rails 8.
除了使SQLite能够为Action Cable、Rails.cache和Active Job供电的Solid适配器之外,还进行了大量工作,使SQLite适配器和Ruby驱动程序适合Rails 8中的实际生产使用。
>> Rails8
GitHub users are now required to enable two-factor authentication as an additional security measure. Your activity on GitHub includes you in this requirement. You will need to enable two-factor authentication on your account before November 08, 2024, or be restricted from account actions.
GitHub用户现在需要启用双因素身份验证作为额外的安全措施。您在GitHub上的活动将您纳入此要求。您需要在2024年11月8日之前在您的帐户上启用双因素身份验证,否则将被限制帐户操作。
>> 2024-9 stadium, gym naked
He is galvanised into action, puts on a crumpled jacket, grabs his tattered coat and scarf, collects up a few of his things, stuffs them into a paper bag.
>> 钢琴家 The Pianist Movie Script
JEHUDA:
You see what a wonderful piece of luck you've had today? That's die historical imperative in action and that's why I always say, look on...
>> 钢琴家 The Pianist Movie Script
Putting Strategic Agility into Action.
将战略敏捷性付诸行动。
>> Why was one able to thrive while the other floundered?
6. Take action.
6.采取行动。
>> 实现目标的7步
The greet action broadcasts specifically to the newcomer, a Turbo Stream update which appends a media element representing the remote client.
问候动作专门向新来者广播,这是一个Turbo Stream更新,它附加了一个代表远程客户端的媒体元素。
>> webRTC Hotwire and Ruby on Rails
Once connected, the room channel broadcasts the presence of this new client.Each connected client then "greets" this newcomer by calling the greet action on the room channel and specifying to and from fields.
连接后,房间频道会广播此新客户端的存在。然后,每个连接的客户端通过在房间通道上调用问候动作并指定往返字段来“问候”这个新来者。
>> webRTC Hotwire and Ruby on Rails
The Stimulus room controller handles Enter button click.It gets the user's local audio and video and feeds them into the local video element. It also starts Action Cable subscriptions specific to the current room: one for communicating WebRTC messages: the Signaller; and one for clients to ping others: the RoomSubscription.
Stimulus控制器处理Enter按钮的点击。它获取用户的本地音频和视频,并将其送到本地视频元素中。它也启动了在针对当前room的 Action Cable 订阅(signaling subscription and room subscription)分别处理webRTC消息和ping其他客户端。
>> webRTC Hotwire and Ruby on Rails
It's going downtown to take action on those E.T.S. Boys.
>> 为人师表 Stand and Deliver (1988) Movie Script