Skip to content

Instantly share code, notes, and snippets.

@cthornton
Created July 3, 2014 03:55
Show Gist options
  • Save cthornton/fc956cff37712fefbbd1 to your computer and use it in GitHub Desktop.
Save cthornton/fc956cff37712fefbbd1 to your computer and use it in GitHub Desktop.
Blog
class PostsController < ApiController
def update
@post = current_user.posts.find(params[:id])
@post.update_attributes!(params[:post])
end
def create
@post = current_user.posts.create!(params[:post])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment