Roy Royal writes:
> I use this type of code for different message and status in my api.
>
> def 404
> respond_to do |format|
> format.json {render json: { error: '404, not found' }, status: 404}
> format.xml {render xml: { error: '404, not found' }, status: 404}
> end
> end
>
> This
I use this type of code for different message and status in my api.
def 404
respond_to do |format|
format.json {render json: { error: '404, not found' }, status: 404}
format.xml {render xml: { error: '404, not found' }, status: 404}
end
end
This works but can I refactoring this code,
2 matches
Mail list logo