Skip to content

Instantly share code, notes, and snippets.

@panSarin
Created August 1, 2012 18:29
Show Gist options
  • Save panSarin/3229545 to your computer and use it in GitHub Desktop.
Save panSarin/3229545 to your computer and use it in GitHub Desktop.
users to fcbk
def to_fcbk
@users = User.where("active = true and (first_name like '%#{params[:q]}%' OR last_name like '%#{params[:q]}%')")
@users = @users.map { |r| {value: r.id, key: "#{r.first_name} #{r.last_name} "} }
render json: @users
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment