diff --git a/README.md b/README.md index 19bc05f..f3d3e85 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,9 @@ This is the first release with JavaScript and jQuery included. As a reference, h ### v[1.2.0] Asynchronously edit and delete jobs +[View pull request](../../pull/6). +[Download release](https://github.com/codeunion/linkedout-example/archive/v1.2.0.zip). + - [X] User can edit jobs on the résumé show page - [X] User can delete jobs on the résumé show page - [X] Editing jobs occurs asynchronously @@ -104,13 +107,19 @@ This is the first release with JavaScript and jQuery included. As a reference, h - [X] Edited jobs are updated on the page without refresh - [X] Deleted jobs are removed from the page without refresh -### v[1.4.0] Asynchronously edit and delete skills +### v[1.3.0] Asynchronously delete skills + +- [X] User can delete skills on the résumé show page +- [X] Deleting skills occurs asynchronously +- [X] Deleted skills are removed from the page without refresh + +This release also makes improvements to the underlying architecture of the application, including the following changes: + +- [X] Use [RESTful routing](http://en.wikipedia.org/wiki/Representational_state_transfer#Applied_to_web_services) conventions +- [X] Logging in `skills.js` +- [X] Format of HTML and JavaScript more consistent -- [ ] User can edit skills on the résumé show page -- [ ] User can delete skills on the résumé show page -- [ ] Editing and deleting skills occurs asynchronously -- [ ] Edited skills are updated on the page without refresh -- [ ] Deleted skills are removed from the page without refresh +In addition, the `/resumes/edit` page has been changed to `/users/edit` and now contains only a form to edit the user profile. This change removes redundancy in editing other resources. ### v[1.5.0] Display education information diff --git a/linkedout.rb b/linkedout.rb index 83027ab..f6aee07 100644 --- a/linkedout.rb +++ b/linkedout.rb @@ -25,14 +25,11 @@ def default_user erb :'resumes/show' end -get "/resumes/edit" do - @jobs = default_user.jobs - @skills = default_user.skills - - erb :'resumes/edit' +get "/users/edit" do + erb :'users/edit' end -put "/users/edit" do +put "/users" do user_attrs = params[:user] default_user.update(user_attrs) @@ -58,11 +55,10 @@ def default_user end end -put "/jobs/edit" do +put "/jobs/:job_id" do + job_id = params[:job_id] job_attrs = params[:job] - job_id = job_attrs.delete("id") - job = Job.get(job_id) job.update(job_attrs) @@ -73,11 +69,10 @@ def default_user end end -delete "/jobs" do +delete "/jobs/:job_id" do + job_id = params[:job_id] job_attrs = params[:job] - job_id = job_attrs.delete("id") - job = Job.get(job_id) job.destroy @@ -96,19 +91,25 @@ def default_user skill.save if request.xhr? # this will return true when handling an AJAX request - partial :'partials/skill', :locals => { :skill => skill } + html = "