Skip to content

Commit

Permalink
Fix lanaguage search to support q or term for select2
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Nov 20, 2024
1 parent d99683a commit c1549c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/languages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def index
@languages = @languages
.includes(:countries)
.order('languages.name')
.where('languages.name like ? OR languages.code like ?', "%#{params[:q]}%", "%#{params[:q]}%")
.where('languages.name like ? OR languages.code like ?', "%#{params[:term] || params[:q]}%", "%#{params[:term] || params[:q]}%")
.limit(10)

@languages = @languages.where(countries_languages: { country_id: params[:country_ids] }) if params[:country_ids]
Expand Down

0 comments on commit c1549c6

Please sign in to comment.