I have some method in before_filter
and I try to render status: 403
. then I get:
Missing template v1/examples/index, v1/base/index, application/index with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}.
I can however render nothing: true
or text: 'some text'
without this error. What am I doing wrong?
Without your code it is hard to tell, but it sounds like you want to do the following:
render json: {}, status: :forbidden
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