Can't display validation errors with best_in_place gem Can't display validation errors with best_in_place gem json json

Can't display validation errors with best_in_place gem


Your problem sounds just like mine: checking carefully at Railscast #302, I noticed that the error message was printing but in the bottom left of the page, hard to see and easy to miss.

The purr CSS code listed that page will format and display it more clearly on the web page.

Hope this helps.


Your should add the right controller action

def update  ..  respond_to do |format|       format.json { render json: @prospect }   endend  

or use the respond_with_bip helper instead. And do not forget to define the .purr CSS class, the "Best In Place" gem uses the jQuery Purr plugin to display error messages:

.purr {  position: fixed;  top: 30px;  right: 100px;  width: 250px;  padding: 20px;  background-color: #FCC;  border: solid 2px #C66;  &:first-letter { text-transform: uppercase; }}


Take care. Add best_in_place.purr plugin instead of jquery.purr in application.js. It worked for me.

//= require jquery//= require jquery_ujs//= require bootstrap//= require best_in_place.purr//= require best_in_place//= require_tree .