Skip to content

Latest commit

 

History

History
executable file
·
37 lines (29 loc) · 825 Bytes

w07d2-solution.md

File metadata and controls

executable file
·
37 lines (29 loc) · 825 Bytes

Assessment - Solution

Week 7 | Day 2

  1. To merge feature2 you need to:
git checkout master
git pull --rebase origin master
git checkout feature2
git rebase master
fix conflicts
git push origin feature2 -f
merge feature2 on github
git checkout master
git pull --rebase origin master
  1. To nest resources :posts inside api/ you need to:
namespace :api do
  resources :posts
end
  1. The folder structure of assets/controllers would have a folder call api and inside the folder there would be posts_controller.rb. Also the first 2 lines should be:
module API
  class PostsController < ApplicationController
  ...
  1. render json: Post.all http://apidock.com/rails/ActionController/Base/render

  2. head xxx xxx is the status code