bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 572 forks source link

Feature request: return different model and field on Save #475

Open jaypinho opened 9 years ago

jaypinho commented 9 years ago

I have a specific use case where I only want administrators (e.g. users with their "role" field set to "admin") to be able to directly change the value of a field.

So I've set up a before_action that checks the user role and then prevents all non-admins from saving directly to the table in question using best_in_place, saving the changes instead to a Revision table (to be approved or rejected later on by an admin).

It would be great to have a feature that binds the best_in_place text box to the Revision table immediately after a non-admin makes a modification. That way, all subsequent edits by that user would simply edit the record in the Revision table, not the actual table that non-admins don't have access to.

Thanks.