Closed yuriy-ivanchenko closed 5 years ago
Thank you, I'm merging this.
Could you please create a new PR where you remove the not needed files? I prefer to keep the repo clean without unused stuff.
Hi @yuriy-ivanchenko! Thanks for the controller and form!
Regarding your https://github.com/arkency/find-open-source-mentor/pull/19#issue-314870236
I think you can add a mentor via hidden field
in the _form partial. Currently we don't have separate roles for mentor and for developer, so you can just pass the current user
to this hidden field. Something like that:
<%= form.hidden_field :user_id, as: :hidden, input_html: { value: current_user.id } %>
should work I believe.
Also, I think we should change the type of project's description - now it is string
, but maybe type text
will be better, so that we could add another field to this _form partial to provide description (apart from name).
Also, I'd suggest to change <%= link_to 'New Project', new_project_path %>
in the project's index view to <%= link_to 'Add New Project', new_repository_path, method: :get %>
, so that once current_user clicks on 'Add New Project' button, he/she is redirected to the list of one's github repositories, and is able to chose the one to add as a project.
/// Sidenote (below is just my thinking - not concrete steps for you to do, so)
Once he/she clicks "Add this repo", page redirects him to new_project_path
and mainly - your _form partial, where he adds name of the project, description etc. I've already changed button's path to new_project_path
in last commit (), so you don't need to do anything here. The only thing to figure out is how to pass this chosen repo to the project's _form as a hidden_field and store it as a link
param in project's table...maybe this way.. but I haven't tried that yet, if you have ideas, feel free to share them!
@oxanayoxana got you
@andrzejkrzywda @oxanayoxana have a suggestion to create a seed file because it will allow devs more comfortable way of developing on the local machine
@yuriy-ivanchenko I never used seed files, if you can create it - feel free to do that ☺️
Stil cannot choose a mentor for a project