Doing http://localhost:3000/options/audio
And I get error:
Missing template options/audio, application/audio with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "/Users/mmahalwy/Desktop/Code/quran.com/QuranAPI/app/views"
When I do http://localhost:3000/options/audio.json
That renders my Jbuilder file and the desired json. How can I render my jbuilder template with the .json extension?
The jbuilder documentation tells you to create your jbuilder template as a *.json.jbuilder file. This makes the route look for the .json extension. If you remove the .json part and make your file *.jbuilder you will be able to go to the route without the .json extension.
Example:
Filename: index.jbuilder
route: get 'ticket', to: 'tickets#index'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With