rename to rswag plus major refactor - almost a rewrite

This commit is contained in:
richie
2016-10-11 18:31:12 -07:00
parent f8d993356f
commit c558098c39
453 changed files with 52410 additions and 35793 deletions

View File

@@ -0,0 +1,23 @@
class BlogsController < ApplicationController
wrap_parameters Blog
respond_to :json
# POST /blogs
def create
@blog = Blog.create(params.require(:blog).permit(:title, :content))
respond_with @blog
end
# GET /blogs
def index
@blogs = Blog.all
respond_with @blogs
end
# GET /blogs/1
def show
@blog = Blog.find_by_id(params[:id])
respond_with @blog, status: :not_found and return unless @blog
respond_with @blog
end
end