Displaying 2 results from an estimated 2 matches for "return_unformatted_text".
2006 Feb 05
2
in_place_editor is missing load_text_url option
...M). So from the scriptaculous example,
this code:
<p id="editme2"><%= textilize( @fancy_text )</p>
<script language="JavaScript">
new Ajax.InPlaceEditor(''editme2'', ''update_text'',
{rows:15,cols:40,loadTextURL:''return_unformatted_text''});
</script>
becomes this:
<p id="editme2"><%= textilize( @fancy_text )</p>
<%= in_place_editor( editme2'',
:url => "update_text",
:load_text_url => "return_unformatted_text",
:rows => 20 )%>
aside: notice...
2006 Feb 18
3
Edit in Place
...splay initially
@fancy_text = "Some fancy *bold* and _emphasized_ text."
end
def update_text
#save your text here, and return the saved value
@fancy_text = params[:value]
render :layout => false, :inline => "<%= textilize( @fancy_text )
%>"
end
def return_unformatted_text
#get your text and return it without the formatting
@fancy_text = "Some fancy edited, *bold* and _emphasized_ text."
render :layout => false, :inline => "<%= @fancy_text %>"
end
#view ( of my_action.rhtml )
<p id="editme2"><%= textiliz...