Serving formats at named route?

I am using a named route, like /abc.
I have put...

respond_to do |format|
format.html
format.json (render :json => @variable)
end

in method.

But when I do /abc.json, it doesn't work.
Any hints?
Thanks.

Do you need /abc.:format in routes.rb for this?