Respond_to and format

Hello!

I use a “format” parameter in my application for internal calculations.
But Rails catches it and uses for view name.
I mean, if I go to url:
myapp.com/foo/?format=xml
Rails tries to show me index.xml.erb view, but I don’t want this! I want
the application to continue showing index.html.erb template.
How can I do this?

Thanks :slight_smile:

wrong url?
check “myapp.com/foo.xml

On 11 ÓÅÎÔ, 15:06, cheef [email protected] wrote:

wrong url?
check “myapp.com/foo.xml

No, no, the task was exactly reverse.
I want to see normal html template (and not xml), but if I pass
“format=xml” as a query parameter, Rails will try to display xml
template (which doesn’t exist)
How to avoid this? I want html to be displayed always and don’t depent
on query parameters.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs