diff --git a/app/models/person.rb b/app/models/person.rb index 04e0d8a1d..f2e844a55 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -97,8 +97,7 @@ def last_updated_at end def path - locale = I18n.locale == I18n.default_locale ? nil : I18n.locale - Rails.application.routes.url_helpers.person_path(self, locale: locale) + Rails.application.routes.url_helpers.person_path(self, locale: I18n.locale) end private diff --git a/app/views/skills/_header.html.haml b/app/views/skills/_header.html.haml index f7b6e6d2d..d356c413f 100644 --- a/app/views/skills/_header.html.haml +++ b/app/views/skills/_header.html.haml @@ -1,7 +1,7 @@ %div.d-flex.flex-column.bg-white{"data-controller": "skillset-selected"} = form_with(url: skills_path, method: :get, data: { turbo_frame: 'skills' }) do |form| %div.d-flex.flex-row.mt-2 - = form.text_field :title, class: "form-control skills-search-field rounded-end-0", placeholder: "#{ti('filter.search', target: Skill.model_name.human(count:2))}", oninput: "this.form.requestSubmit()", include_blank: true + = form.text_field :title, class: "form-control skills-search-field rounded-end-0", placeholder: "#{ti('filter.search', target: Skill.model_name.human)}", oninput: "this.form.requestSubmit()", include_blank: true %div.border.d-flex.rounded-end.bg-white %img.pointer.p-2{src: "/assets/search.svg"} %div.d-flex.flex-row.mt-3.flex-wrap.gap-2 @@ -21,6 +21,6 @@ %span.d-flex.align-items-center.flex-wrap %span.text-gray.me-1 = "#{Category.model_name.human}:" - = form.collection_select :category, Category.all_parents.order(:title), :id, :title, {include_blank: "Select a category"}, class: "form-select fit-content", onchange: 'this.form.requestSubmit();' + = form.collection_select :category, Category.all_parents.order(:title), :id, :title, {prompt: true}, class: "form-select fit-content", onchange: 'this.form.requestSubmit();' = export_action_link export_skills_path = add_action_link_modal diff --git a/spec/features/people_spec.rb b/spec/features/people_spec.rb index 6f779aa68..101b27f92 100644 --- a/spec/features/people_spec.rb +++ b/spec/features/people_spec.rb @@ -20,14 +20,14 @@ visit people_path bob = people(:bob) select_from_slim_select("#person_id_person", bob.name) - expect(page).to have_current_path(person_path(bob, locale: nil)) + expect(page).to have_current_path(person_path(bob)) end it 'redirect to the first entry' do visit people_path sorted_list = people_list.sort_by { |item| item.name.downcase } ss_select_index("#person_id_person", 1) - expect(page).to have_current_path(person_path(sorted_list.first.id, locale: nil)) + expect(page).to have_current_path(person_path(sorted_list.first.id)) end it 'should only display matched people' do