Sha256: 7f930717032a1994aac5b40a90c3da053fb6bac9c5e3f386ad63d8193164e977

Contents?: true

Size: 458 Bytes

Versions: 6

Compression:

Stored size: 458 Bytes

Contents

class DirectoryLookupController < ApplicationController
  def search
    @selector = params[:selector]
    vcard_params = extract_vcard_params(params, @selector)

    @vcard = Vcard.new(vcard_params)
    render 'vcards/directory_lookup'
  end

  private
  def extract_vcard_params(params, selector)
    keys = selector.delete(']').split('[');
    vcard_params = params
    keys.each {|key| vcard_params = vcard_params[key]}
    return vcard_params
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
has_vcards-0.20.3 app/controllers/directory_lookup_controller.rb
has_vcards-0.20.2 app/controllers/directory_lookup_controller.rb
has_vcards-0.20.1 app/controllers/directory_lookup_controller.rb
has_vcards-0.20.0 app/controllers/directory_lookup_controller.rb
has_vcards-0.19.0 app/controllers/directory_lookup_controller.rb
has_vcards-0.18.0 app/controllers/directory_lookup_controller.rb