# Render :text in Rails 2.1

**URL:** <https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125>\
**Category:** Rails\
**Created:** [July 3, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125 "2008-07-03T18:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [July 3, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125/1 "2008-07-03T18:15:50Z")

</div>

I’m trying to get my “in place editor” controls working again after  
moving up to Rails 2.1. I got the authenticity token working and  
everything is fine except the render. Maybe I never did it right in the  
first place.

I do:

resond\_to do |format|  
format.html { render :text =\> new\_text }  
end

This is what the “Rails Book” (Dave T. and DHH) says to reply with  
but it might be out of date by now.

I am now getting the whole layout sent back.

I don’t really want to do “render :update” because this piece of code  
works with lots of controls and I’d have to figure out which control to  
update or replace.

Any ideas?

Thanks,

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [July 3, 2008, 6:18pm UTC](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125/2 "2008-07-03T18:18:48Z")

</div>

Perry S. wrote:

> I do:
> 
> resond\_to do |format|  
> format.html { render :text =\> new\_text }  
> end

Have you tried

{render :text =\> new\_text, :layout =\> false}

?

I do that with partials periodically, but can’t say that I’ve tried it  
with render: text, which I don’t really use much.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [July 3, 2008, 7:10pm UTC](https://www.ruby-forum.com/t/render-text-in-rails-2-1/142125/3 "2008-07-03T19:10:45Z")

</div>

Phillip K. wrote:

> Perry S. wrote:
> 
> > I do:
> > 
> > resond\_to do |format|  
> > format.html { render :text =\> new\_text }  
> > end
> 
> Have you tried
> 
> {render :text =\> new\_text, :layout =\> false}

My new\_text was (and it wasn’t suppose to be). There is a bug already  
reported about this.

Thanks!
