Hey all, I am working on some validation for the in_place_editor_field and I have a custom handler to catch and preform all of the saving and to execute validation. I’m pretty close to being satisifed with the results, but I have one nagging problem. When I get into the else block of the below code, the following is displayed in the in place editor field:
“page.replace_html(“custom_field_name_#{params[:id]}_in_place_editor”, @category.send(:name))”
Any ideas on why this might happen? My controller code is below.
def set_category_name
@category = Category.find(params[:id])
previous_name = @[category.name](http://category.name)
@[category.name](http://category.name) = params[:value]
if @category.save
render :text => @[category.name](http://category.name)
else
render :update do |page|
page.alert("Category name must not be blank.")
page.replace_html
(“custom_field_name_#{params[:id]}_in_place_editor”, previous_name) end
end
end