bernat/best_in_place — Issue #81: :nil always gets displayed if :display_as is used
Author: bratsche
Created: 2012-01-11 02:51:35+00:00
State: open

I'm doing something kind of like:

<%= best_in_place current_user,
:bio_markup,
:display_as => :bio
:type => :textarea,
:ok_button => "Save",
:path => update_bio_path,
:nil => "Some block of text to display if nil"
%>

Initially everything is great, it displays "Some block of text to display if nil". The user clicks that, edits it to "This is edited text", hits enter.. everything is perfect. Refresh the page, now they see "Some block of text to display if nil" *and* "This is edited text".

It's displaying the text for :nil when it shouldn't. Inspecting the User object, there is text saved on both the bio and bio_markup fields (as there should be).