У меня есть метод в контроллере
def custom_method
@object = Customer.find_by(attribute: params[:attribute])
@object.self_method if @object.present?
end
маршрут
resources :customers do
collection do
patch :custom_method
end
end
форма
= form_with(url: custom_method_customers_path, method: :patch) do
= text_field_tag :attribute
= submit_tag "Submit"
Что я делаю не так? Хотелось бы увидеть актуальное решение с примерами, спасибо!