Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Are you sure params[:value] is actually an empty string? I'd shorten
that to
params[:value] = "Hey! You must fill the field!" if
params[:value].blank?
or, to avoid a string of spaces [correctly] validating as !blank?,
params[:value] = "Hey! You must fill the field!" if
params[:value].strip.blank?
RSL

The reason it's not work is because in_place_edit_for defines an
instance method which will access params at run-time. Not define
time. So the statement you put before super will have no effect.
23: def in_place_edit_for(object, attribute, options = {})
24: define_method("set_#{object}_#{attribute}") do
25: @item =
object.to_s.camelize.constantize.find(params[:id])
26: @item.update_attribute(attribute, params[:value])
27: render :text => @item.send(attribute)
28: end
29: end
You should monkey patch this method or you can simply define the
action it would have defined yourself.
For some reason it has an options parameter but never uses it... so
your patch could be flexible.
e.g.
in_place_edit_for(:post, :comment, :check_blanks => true, :blank_error
=> 'What do you want to say?')
---
module ActionController
module Macros
module InPlaceEditing
module ClassMethods
def in_place_edit_for(object, attribute, options = {})
define_method("set_#{object}_#{attribute}") do
@item = object.to_s.camelize.constantize.find(params[:id])
if params[:value].blank? && options[:check_blanks]
render :text => options[:blank_error] || "Fill in this
field."
else
@item.update_attribute(attribute, params[:value])
render :text => @item.send(attribute)
end
end
end
end
end
end
end