added some Ajax routes
This commit is contained in:
parent
eecdecfda9
commit
4db8f8f33f
|
@ -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
|
|
@ -27,6 +27,8 @@ Rails.application.routes.draw do
|
||||||
match '/ask', to: 'question#create', via: :post, as: :ask
|
match '/ask', to: 'question#create', via: :post, as: :ask
|
||||||
match '/answer', to: 'inbox#destroy', via: :post, as: :answer
|
match '/answer', to: 'inbox#destroy', via: :post, as: :answer
|
||||||
match '/destroy_answer', to: 'answer#destroy', via: :post, as: :destroy_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
|
end
|
||||||
|
|
||||||
match '/inbox', to: 'inbox#show', via: 'get'
|
match '/inbox', to: 'inbox#show', via: 'get'
|
||||||
|
|
Loading…
Reference in New Issue