Hello and welcome in this show we are going to create the action that will enable us to create a new
post or actions are created in siby controller.
So I'm going to expand our field here and expand that directory and click on control on the controller.
Click on the pulse controller.
So this is where will define all the methods or actions for our ports controller.
We've already got one action in May which is index or just tab down.
Let's create another one that will enable us to create or add a new post.
So do we have to define it and give it a name we'll call it new and just type end and so that's basically
it.
We've added a new action called new that will enable us to add a new post.
I'm just going to click File and say that the actions inside the controllers should have a corresponding
view.
So I'm going to create you for this action we've just created.
So let's loop full.
You direct three wishes here on The View.
There should be a post.
Let me the decrees that expanded again.
And you can see the post here so this is where his site is very frequent posts his Where we to create
a new view.
So right click on the post and click new file.
See.
Has no see his saves to post view and there is already one view there so we can call it a new dot Hey
t l DOT E R B E R B stands for embedded Ruby and have a quick C..
So we've now created in new view you we're just going to add a tag to it.
One tag is going to say hey one and say had.
And I'll say that.
Sabl.
We've already got a rout for that.
The rout was already being defined and when we did the resources.
So now if I open up the page this is our application page.
I should be able to navigate to the slas new Sorry slash post and then slash new.
Okay so you can see we can communicate with the control.
He can tell by the link we have because all the rules have already been defined.
True when we added it added the post as a resource.
So here hear this now we are now in a different rout.
We knew the view correctly displayed is Few here which you've just created called New doty's email don't
ya.
So we can see this view.
Here we are in our next lecture we are going to add a form to these few where people can read and post
their new post.
Okay that's the planful in next lecture.
For now thanks for watching.
Bye for now.