I've difficulties with keeping my controllers not too complicated and with the basic actions rails creates when we scaffold.
Could someone tell me if the approach below is the right one.
I've a model Project
and those basic routes it:
GET /projects -> Project#index
GET /projects/new -> Project#new
POST /projects -> Project#create
GET /projects/:id -> Project#show
GET /projects/:id/edit -> Project#edit
PATCH /projects/:id -> Project#update
PUT /projects/:id -> Project#update
Now I would like to allow the user to accept the project. First he has a summary view where he can push a button and it should change some value in the model.
My first attempt was
GET /projects/:id/accept -> Project#accept
POST /projects/:id/accept -> Project#accept_update
This just doesn't feel right.
So I 'm wondering if I should do it in this way:
GET /projects/:id/accept -> Acceptations#new
POST /projects/:id/accept -> Acceptations#create
But then, I've my Acceptations controller that is dealing with Project
models. What starts being confusing for me.
On top of that, if I go with the second options, should the path be /projects/:id/acceptations/new
this seems long and confusing for the end user.