- 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
- To nest
resources :posts
insideapi/
you need to:
namespace :api do
resources :posts
end
- The folder structure of
assets/controllers
would have a folder callapi
and inside the folder there would beposts_controller.rb
. Also the first 2 lines should be:
module API
class PostsController < ApplicationController
...
-
render json: Post.all
http://apidock.com/rails/ActionController/Base/render -
head xxx
xxx is the status code