絞り込み検索の選択肢がべた書きでダサい件について。 例) ・モデルabc ・カラム :name, :year, :title ・一つのデータごとに:yearには2015~2018年のいずれかが入っている。 →絞り込み検索で各年のデータを取得・表示したい。 こんな感じで書くことで一応問題なく絞り込めています。 def index @abcs = Abc.all end def search @abcs = Abc.where('year LIKE ?', "%#{params[:year]}%") render :index end ※以下params(省略) <%= form_tag(abc_search_path, method: "get") do %> <%= select_tag(:year, options_for_select([["2015","2015"],["2016",