Skip to content

Instantly share code, notes, and snippets.

@coreyjs
Created December 19, 2013 03:46
Show Gist options
  • Save coreyjs/8034115 to your computer and use it in GitHub Desktop.
Save coreyjs/8034115 to your computer and use it in GitHub Desktop.
deserialize mutli params
# deserialze tag params, idea is to check for tag save/change, always update to newest params
# find all tags associated with beacon, transform to array and return to the controller
def self.deserialize_tag_parameters(params)
if !params[:beacon][:tags].nil?
if !params[:beacon][:tags].empty?
code_array = params[:beacon][:tags].split(',')
logger.debug "Tag params parsed out" + code_array.to_s
tags = Tag.where(:code.in => code_array)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment