diff --git a/README.adoc b/README.adoc index 47652a5..590cba1 100644 --- a/README.adoc +++ b/README.adoc @@ -1921,6 +1921,23 @@ travel_to(Time.current.to_time) freeze_time ---- +=== HTTP URL [[http-url]] + +Prefer passing a string literal as a URL to HTTP methods to make the actual URL obvious and to facilitate tracking endpoint path changes. + +[source,ruby] +---- +# bad +get photos_path +put photo_path(id) +post edit_photo_path(id) + +# good +get "/photos" +put "/photos/#{id}" +post "/photos/#{id}/edit" +---- + == Managing Processes === Foreman [[foreman]]