Add contact show

This commit is contained in:
Martin Lensment 2014-09-18 18:01:32 +03:00
parent 1777a0e572
commit 2d2a12b7d0
12 changed files with 131 additions and 6 deletions

View file

@ -1,4 +1,5 @@
class Admin::ContactsController < ApplicationController
before_action :set_contact, only: [:show]
def index
@q = Contact.search(params[:q])
@ -8,4 +9,10 @@ class Admin::ContactsController < ApplicationController
def search
render json: Contact.search_by_query(params[:q])
end
private
def set_contact
@contact = Contact.find(params[:id])
end
end