arkency / find-open-source-mentor

A platform to connect junior developers with open source projects
35 stars 11 forks source link

controller for project. Add fields to projects table #19

Closed yuriy-ivanchenko closed 5 years ago

yuriy-ivanchenko commented 5 years ago

Stil cannot choose a mentor for a project

andrzejkrzywda commented 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.

oxanayoxana commented 5 years ago

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!

yuriy-ivanchenko commented 5 years ago

@oxanayoxana got you

yuriy-ivanchenko commented 5 years ago

@andrzejkrzywda @oxanayoxana have a suggestion to create a seed file because it will allow devs more comfortable way of developing on the local machine

oxanayoxana commented 5 years ago

@yuriy-ivanchenko I never used seed files, if you can create it - feel free to do that ☺️