# In\_place\_editor not working for Internationalization

**URL:** <https://www.ruby-forum.com/t/in-place-editor-not-working-for-internationalization/123830>\
**Category:** Rails\
**Created:** [December 21, 2007, 2:48am UTC](https://www.ruby-forum.com/t/in-place-editor-not-working-for-internationalization/123830 "2007-12-21T02:48:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![franz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c37758/32.png) [@franz](https://www.ruby-forum.com/u/franz)\
**Post date:** [December 21, 2007, 2:48am UTC](https://www.ruby-forum.com/t/in-place-editor-not-working-for-internationalization/123830/1 "2007-12-21T02:48:11Z")

</div>

I’m trying to implement internationalization in my app. I followed  
the instructions on the Globalize example (http://wiki.globalize-  
[rails.org/globalize/show/Example+Application](http://rails.org/globalize/show/Example+Application)), using in\_place\_editor.  
The translation works fine, however, I can’t get in\_place\_editor to  
work to translate the strings.

My controller:

class Admin::TranslateController \< ApplicationController  
in\_place\_edit\_for :translation, :text

def index  
@view\_translations = ViewTranslation.find(:all, :conditions =\>  
[‘built\_in IS NULL AND language\_id = ?’, Locale.language.id], :order  
=\> ‘text’)  
end

def translation\_text  
@translation = ViewTranslation.find(params[:id])  
render :text =\> @translation.text || “”  
end

def set\_translation\_text  
@translation = ViewTranslation.find(params[:id])  
previous = @translation.text  
@translation.text = params[:value]  
@translation.text = previous unless @translation.save  
render :partial =\> “translation\_text”, :object =\>  
@translation.text  
end  
end

And the call in view:

\<%= in\_place\_editor “tr\_#{tr.id}”,  
:url =\> { :action =\> :set\_translation\_text, :id =\> tr.id },  
:load\_text\_url =\> url\_for({ :action =\> :translation\_text, :id =\>  
tr.id })%\>

It loads the value that it gets from translation\_text, but when I try  
to change the string, all it says in the box is ‘Saving…’ and it  
never updates the entry.

---

<div class="post-metadata">

**Author:** ![franz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c37758/32.png) [@franz](https://www.ruby-forum.com/u/franz)\
**Post date:** [December 21, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/in-place-editor-not-working-for-internationalization/123830/2 "2007-12-21T23:24:08Z")

</div>

On 21 Dec 2007, at 01:47, Franz wrote:

> I’m trying to implement internationalization in my app. I followed  
> the instructions on the Globalize example (http://wiki.globalize-  
> [rails.org/globalize/show/Example+Application](http://rails.org/globalize/show/Example+Application)), using in\_place\_editor.  
> The translation works fine, however, I can’t get in\_place\_editor to  
> work to translate the strings.

If your app is a rails 2.0 app, in\_place\_editor currently doesn’t work  
with crsf.

Fred
