Tuesday, 15 June 2010

ruby on rails - Jbuilder without the .json extension -



ruby on rails - Jbuilder without the .json extension -

doing http://localhost:3000/options/audio

and error:

missing template options/audio, application/audio {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. searched in: * "/users/mmahalwy/desktop/code/quran.com/quranapi/app/views"

when http://localhost:3000/options/audio.json

that renders jbuilder file , desired json. how can render jbuilder template .json extension?

the jbuilder documentation tells create jbuilder template *.json.jbuilder file. makes route .json extension. if remove .json part , create file *.jbuilder able go route without .json extension.

example:

filename: index.jbuilder route: 'ticket', to: 'tickets#index'

ruby-on-rails jbuilder

No comments:

Post a Comment