I’ve got a bog-standard view which displays textilized data. In the same
view, I have an in_place_editor which uses load_text_url to bring in
non-textilized data when editing.
Now, if I have html tags in the data loaded from load_text_url, they
appear to go missing. I can see the tags in the output from my
controller method using the console, but the tags are not shown in the
in_place_editor textarea and – most importantly – appear to actually
have been stripped from the text sent by the controller method (I’ve run
it through the DOM inspector in Firefox to double-check).
Oddly, if I disable load_text_url for the in_place_editor, html tags
from the rendered page are shown inside the editing textarea without
trouble. So, it looks like something is occurring in load_text_url.
missing something completely obvious here?
My controller method for load_text_url:
@page = Page.find(params[:id])
render :text => @page.data
My view code:
<%= in_place_editor “data”,
:load_text_url => url_for( :controller => ‘pages’, :action =>
‘get_data’, :id => @page.id ),
:url => pages_url( :action => ‘update_attribute’, :id =>
@page.id, :target => ‘data’ ),
:rows => 25, :cols => 80 %>
My sample data:
h1. Sample method
The following is a sample method…
def load @foo = Baz.find(:first) return @foo.bar end