Skip to content

Instantly share code, notes, and snippets.

@tlkahn
Created June 27, 2025 01:11
Show Gist options
  • Save tlkahn/9a3b82912aa4e09862b3b5c98003419e to your computer and use it in GitHub Desktop.
Save tlkahn/9a3b82912aa4e09862b3b5c98003419e to your computer and use it in GitHub Desktop.
a.md

The route definition

post "/sandhi/analyze", to: "sandhi_analyses#analyze"

automatically includes an optional :format segment, so both

/sandhi/analyze      # no explicit format
/sandhi/analyze.json # JSON extension

match the same sandhi_analyses#analyze action.

Your controller already renders JSON (either with render json: or in the respond_to do |format| … format.json … end block), so a POST to #{API_ROOT}/sandhi/analyze.json is fully supported without any additional routing changes.


https://chatgpt.com/g/g-p-68316d9ee388819197588c31d13a5822-sloka-analysis-copilot-api/c/685dedaf-6a94-800b-95e7-85efdc8e857a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment