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.
9f6e775366f2f607647fab8eeed66507?d=identicon&s=25 Vapor .. (vapor)
on 2009-04-27 18: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.
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2009-04-27 18:26
(Received via mailing list)
Do you need /abc.:format in routes.rb for this?

2009/4/27 Vapor .. <rails-mailing-list@andreas-s.net>
9f6e775366f2f607647fab8eeed66507?d=identicon&s=25 Vapor .. (vapor)
on 2009-04-27 18:31
Colin Law wrote:
> Do you need /abc.:format in routes.rb for this?

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