Forum: Ruby on Rails Serving formats at named route?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vapor .. (Guest)
on 2009-04-27 20:04
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.
Colin L. (Guest)
on 2009-04-27 20:26
(Received via mailing list)
Do you need /abc.:format in routes.rb for this?

2009/4/27 Vapor .. <removed_email_address@domain.invalid>
Vapor .. (Guest)
on 2009-04-27 20:31
Colin L. wrote:
> Do you need /abc.:format in routes.rb for this?

Great, thanks!
This topic is locked and can not be replied to.