Unable to send email as parameter in URL in Rails
问题 I am writing an API to find users by email_id . I am getting an error while sending the email as a parameter. Routes.rb: Rails.application.routes.draw do namespace :api do resources :users, only: [:show, :index] , param: :email end end When I am sending the email as a parameter then I got an error. The URL is http://localhost:3000/api/users/test@abc.com: ActiveRecord::RecordNotFound in Api::UsersController#show Couldn't find User with 'id'={:email=>"test@abc"} This is my routes path: api