Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


render :partial should accept :format option #4841

jfirebaugh opened this Issue · 8 comments

7 participants


It's currently difficult to render a partial with a different format from the current response:

render :partial => <partial>, :format => :html should work how you would expect.


This works: render :partial => <partial>, :formats => [:html]

It would be more natural to specify :format => :html if you only want to specify one.


I am fine with :formats accepting a symbol and not an array, but :-1: for having another option just to accept a symbol.


you could do render :partial => <partial>, :formats => :html

@spastorino spastorino closed this

The problem with the formats option is that partials rendered from others will still use the current action's format.

That means it is impossible to render that renders another one.


  -> index.json
      -> post.json (this is not possible to render because the format is html)

How do you deal with it?


@dnagir I came across this too and provided a patch #6626, unfortunately it cannot be backported to 3.2. I have no idea how to fix this without monkey patching for current version.


Thanks @route. No backporting means we'll get sooner onto rails 4 :)

For now I'm using this workaround.


No problem, I'm waiting for this event too ;)


:+1: for render with :format, took me some hours for something that stupid, since it is totally legible and it is a good idea test each view formats separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.