Closed NicosKaralis closed 12 years ago
I think this is less of a RABL issue or more of a Rails template lookup scenario.
My initial concern is with your application responding with cidade as the next lookup. Do you have any ActiveSupport inflections setup to rename the plural of city to cidade? (local differences maybe)
Overall city.rabl and cities.rabl should work. Another option if you're doing it in response to a single city and many cities is taking the controller route of INDEX and SHOW. In my case, I would suggest that your cities controller has a show method that renders cities/show.rabl and an index method that renders cities/index.rabl which would have been city.rabl and cities.rabl respectively.
You may have better luck opening up the question to StackOverflow. Link the question here and I'll help there as well.
If you have any other questions, just reopen.
I'm having some difficulties in integrating two or more formats using the same template.
I have the following views:
in my controller i have:
if I try access:
/city.json
or/city.xml
or/city.plist
works finebut if I try to access
/cities.json
or/cities.xml
or/cities.plist
returns me this error:if i change the
city.rabl
tocity.json.rabl
then/cities.json
or/cities.xml
or/cities.plist
begin to work, but/city.xml
or/city.plist
stop workingthe basic code for city and cities are the following:
api/city.rabl
api/cities.rabl
my question is: Is there a way to create a "generic" view witch i can use the same to many different formats?