Rails should respond with the proper HTTP error codes in correlation to the conventions of the HTTP protocol. I've worked with Rails for a while and haven't seen any exceptions. You can also raise your own exceptions like this
@record = ModelName.find_by(field_name_goes_here: params[:some_parameter_name_goes_here])
if not @record.blank?
render "view_file_name_goes_here"
else
raise ActiveRecord::RecordNotFound
end
This code will cause rails to respond with a 404.
Making a request for a route that has not been defined will also result in a 404.
Other examples:
A syntax error in your code will respond with a 500.
If you are using devise or some other gem for authorization, an unauthorized request will result in rendering a 401. There won't be anything in Rails that would render a 401 out of the box. Remember, all of your requests are defined through routes.rb and it's up to your controllers to decide what response to render and if that response should return an HTTP error code.
This question here provides information on how to render all types of error codes:
Return a specific http status code in Rails
If you are looking to debug the http error code I would suggest setting the rails environment configuration to consider all requests as local requests. This will display an understandable error.
Purpose of "consider_all_requests_local" in config/environments/development.rb?