This project is archived and is in readonly mode.
rendering rjs partial breaks response content type
Reported by Alexander Stanko | February 21st, 2010 @ 07:09 PM | in 3.0.2
I trying to render _some_partial.rjs in action template (index.html.haml (or .erb)), after that I see html content in browser like simple text, becouse response conteins header: Content-Type: text/javascript; charset=utf-8
Rails 3.0.0.beta1
ruby 1.9.2dev
Comments and changes to this ticket
-
José Valim February 21st, 2010 @ 07:36 PM
- Assigned user set to Yehuda Katz (wycats)
-
Alexander Stanko February 22nd, 2010 @ 10:29 AM
Here is a diff file with the test that you have requested.
-
Alexander Stanko February 22nd, 2010 @ 12:19 PM
- Tag changed from rjs to rails3, rjs
-
José Valim February 23rd, 2010 @ 09:18 PM
- Assigned user changed from Yehuda Katz (wycats) to José Valim
-
José Valim February 26th, 2010 @ 11:19 AM
- State changed from new to open
Hey Alexander, thanks for the patch!
I'm looking for a solution, meanwhile, do you mind creating a new patch using git format-patch? This way you will have the commit authorship.
-
Alexander Stanko February 26th, 2010 @ 11:30 AM
- no changes were found...
-
José Valim February 27th, 2010 @ 08:17 AM
- Assigned user changed from José Valim to Yehuda Katz (wycats)
-
José Valim June 7th, 2010 @ 11:27 PM
- State changed from open to invalid
- Assigned user changed from Yehuda Katz (wycats) to José Valim
After discussing with Yehuda once again and other people, we came to the fact we don't want to support this scenario explicitly. If you need to render another formats (like js) from a template, you will need to explicitly tell the lookup context object (which holds all information used on lookup) that it should consider this new format. In your case, you should try something like this:
update_details(:formats => [:js]){ render "rjs_template" }
Please let me know if it works as expected!
-
Falk Pauser August 31st, 2010 @ 02:34 PM
- Importance changed from to High
I just needed this too - and it works as expected:
<%= update_details(:formats => [:js]) { render 'shared/specific-js-template' } %>
-
csnk May 18th, 2011 @ 08:28 AM
We are the professional underwear manufacturer, underwear supplier, underwear factory, custom underwear.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>