ruby - Reddit clone in Rails with Rspec, resource_controller problem -
^ ^ My code goes there yet.
Basically, I am using the resource_controller and I do not really understand the resource_controller when I used the scaffolding to make my post model, I used it in the field like
: The integer had told the original # at which level the post is (this post ID is the guardian of this post): Integer user_id # I meant it to be something like user.Id
Now, the forming form makes me put those values into them . However, I want them to be automatically put in with the controller and not present anything to the user. As such, in backend logic, I have to set up @ post.user_id = @ user.id or something like that.
However, since the resource_controllers make all the way, such as creating, indexing, new, editing, destroying, whatever, I do not know where I can edit the function.
I am very new in TDD and Rental design. I have worked some original Rail / Ruby items in the past but have not touched it for some time till now.
Appreciate some guidance! :)
My first suggestion is to use the resource controller as long as you are not comfortable with the tracks. Do not You can still design TDD and silk with Scaffold - they are lush.
If you paste it with a resource controller, do this:
class PostsController & lt; ResourceController :: Create Base. First make @ post.user_id & lt; & Lt; Current_user.id end and
Comments
Post a Comment