Hi, I have a question about ruby ββon rails
Apparently I have an instruction like this:
def sort_column Product.column_names.include?(params[:sort]) ? params[:sort] : "name" end
From what I read, he said that this method sorts the column based on params [: sort], and if there are no parameters, the products will be sorted by "name". However, I do not understand how this expression is written, especially the second "?". Can someone explain this to me?
source share