Edit in Place


#1

I need help using In Place Editor by script.aculo.us

#controller
def my_action
#get the text to display 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 )

<%= textilize( @fancy_text )

They have this example at their site. What else should I do because if
doing just that, it doesn’t work.

Thanks


#2

I have installed RedCloth already: gem install redcloth

Should I also include require ‘redCloth’ somewhere?


#3

No need to do that.

Cheers
Luke R.


#4

Thanks Luke,

Finally it is working, I didn’t add the controls.js file.