<% select_option = [] (select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project (select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course select_option << ['用户', 'users'] %> <%= form_tag({controller: :welcome, action: :search }, method: :get) do %> <% end %>