Created
August 1, 2012 18:29
-
-
Save panSarin/3229545 to your computer and use it in GitHub Desktop.
users to fcbk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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