added some Ajax routes

This commit is contained in:
nilsding 2014-11-30 14:45:32 +01:00
parent eecdecfda9
commit 4db8f8f33f
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,13 @@
class Ajax::FriendController < ApplicationController
def create
@status = :okay
@message = "Successfully followed user."
@success = true
end
def destroy
@status = :okay
@message = "Successfully unfollowed user."
@success = true
end
end

View File

@ -27,6 +27,8 @@ Rails.application.routes.draw do
match '/ask', to: 'question#create', via: :post, as: :ask
match '/answer', to: 'inbox#destroy', via: :post, as: :answer
match '/destroy_answer', to: 'answer#destroy', via: :post, as: :destroy_answer
match '/create_friend', to: 'friend#create', via: :post, as: :create_friend
match '/destroy_friend', to: 'friend#destroy', via: :post, as: :destroy_friend
end
match '/inbox', to: 'inbox#show', via: 'get'