Project

General

Profile

« Previous | Next » 

Revision 86fb12c1

Added by Ohad Levy almost 12 years ago

  • ID 86fb12c1e1009385163d2d255ae6e519f18ea452

cleanup after merge conflict with latest develop branch

View differences:

app/controllers/api/v1/bookmarks_controller.rb
class BookmarksController < BaseController
before_filter :find_by_name, :only => [:show, :update, :destroy]
api :GET, "/bookmarks/", "List all bookmarks."
def index
@bookmarks = Bookmark.all
end
api :GET, "/bookmarks/:id/", "Show a bookmark."
def show
end
api :POST, "/bookmarks/", "Create a bookmark."
param :bookmark, Hash, :required => true do
param :name, String, :required => true
param :controller, String, :required => true
param :query, String, :required => true
end
def create
@bookmark = Bookmark.new(params[:bookmark])
process_response @bookmark.save
end
api :PUT, "/bookmarks/:id/", "Update a bookmark."
param :bookmark, Hash, :required => true do
param :name, String
param :controller, String
param :query, String
end
def update
process_response @bookmark.update_attributes(params[:bookmark])
end
api :DELETE, "/bookmarks/:id/", "Delete a bookmark."
def destroy
process_response @bookmark.destroy
end

Also available in: Unified diff