Sha256: f2ea3b4b76b4935f4ecc6fa3c28fd123b22e0236c87012bc2c5dba0f56a7bc3a

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 Bytes

Contents

class VcardsController < ApplicationController
  # User inherited resources logic
  inherit_resources
  respond_to :html, :js

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

  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
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
has_vcards-0.20.3 app/controllers/vcards_controller.rb
has_vcards-0.20.2 app/controllers/vcards_controller.rb
has_vcards-0.20.1 app/controllers/vcards_controller.rb
has_vcards-0.20.0 app/controllers/vcards_controller.rb
has_vcards-0.19.0 app/controllers/vcards_controller.rb
has_vcards-0.18.0 app/controllers/vcards_controller.rb
has_vcards-0.17.2 app/controllers/vcards_controller.rb
has_vcards-0.17.1 app/controllers/vcards_controller.rb