Class: Droom::PeopleController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Droom::PeopleController
- Defined in:
- app/controllers/droom/people_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/droom/people_controller.rb', line 29 def create if @person.update_attributes(params[:person]) respond_with @person do |format| format.js { render :partial => "droom/users/user_or_person" } format.html { render :partial => "droom/people/person" } end else respond_with @person end end |
#destroy ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'app/controllers/droom/people_controller.rb', line 51 def destroy @user = @person.user @person.destroy if @user respond_with @user do |format| format.js { render :partial => "droom/users/user_or_person"} format.html { head :ok } end else head :ok end end |
#index ⇒ Object
13 14 15 16 17 18 |
# File 'app/controllers/droom/people_controller.rb', line 13 def index respond_with @people do |format| format.js { render :partial => 'droom/people/people' } format.vcf { render :vcf => @people.map(&:to_vcf) } end end |
#invite ⇒ Object
64 65 66 67 |
# File 'app/controllers/droom/people_controller.rb', line 64 def invite @user = @person.invite! render :partial => "droom/users/user_or_person", :locals => {:user_or_person => @person} end |
#show ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/controllers/droom/people_controller.rb', line 20 def show respond_with @person do |format| format.js { @invitation = Droom::Invitation.find_by_id(params[:invitation_id]) render :partial => 'droom/people/person' } end end |
#update ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/droom/people_controller.rb', line 40 def update if @person.update_attributes(params[:person]) respond_with @person do |format| format.js { render :partial => "droom/users/user_or_person" } format.html { render :partial => "droom/people/person" } end else respond_with @person end end |