Sha256: 25e198a63a59d40735e6ff331a5ea3e0757504c80d78e1514030448cad5cfc32
Contents?: true
Size: 681 Bytes
Versions: 5
Compression:
Stored size: 681 Bytes
Contents
class ContactsController < ApplicationController def index return if current_subject.blank? myContacts = Array.new mySubjects = current_subject.subjects(:direction => :receivers) return if mySubjects.blank? #Fill the array with actor name/actorId of all the actors which has a tie with current_subject mySubjects.each do |aSubject| aSubjectD = {} aSubjectD['key'] = aSubject.name aSubjectD['value'] = aSubject.actor_id.to_s myContacts << aSubjectD end respond_to do |format| format.html #index.html.erb format.json { render :text => myContacts.to_json } end end end
Version data entries
5 entries across 5 versions & 1 rubygems