Class: VcardsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/vcards_controller.rb

Instance Method Summary collapse

Instance Method Details

#directory_lookupObject



6
7
8
# File 'app/controllers/vcards_controller.rb', line 6

def directory_lookup
  @vcard = Vcard.find(params[:id])
end

#directory_updateObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/vcards_controller.rb', line 10

def directory_update
  @vcard = Vcard.find(params[:id])
  new_params = params[:vcard].select{|key, value| ['family_name', 'given_name', 'street_address', 'postal_code', 'locality'].include?(key)}

  @vcard.update_attributes(new_params)

  @vcard.save

  redirect_to @vcard.object
end