How to give sort_by name in where condition in rails -


i have included given code

  @operator_selected = operator.where(:id => selected_operator).map{|opr| opr.name} 

i want show operator sort name. please guide me how this.

try this

@operator_selected = operator.where(:id => selected_operator).order(:name).map{|opr| opr.name} 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -