RailsCasts Pro episodes are now free!

Learn more or hide this

Felipe's Profile

GitHub User: harn

Comments by Felipe

Avatar
ruby
 respond_to do |format|
                        format.html { render action: request.path[1..-1], status: request.path[1..-1] }
                        format.json { render json: {status: request.path[1..-1], error: @exception.message}, status: request.path[1..-1]}
                end
Avatar
ruby
                respond_to do |format|
                        format.html { render action: request.path[1..-1], status: 404 }
                        format.json { render json: {status: request.path[1..-1], error: @exception.message}, status: 404}
                end

Using status respond to the error is better for others system knows what is happeing