HI, I'm using a jquery plugin (the amazing vitalet's x-editable plugin) that allows you to inline edit your models. This plugin send via POST request parameters like:
pk=2 name=title value=my new title
where "name" is the attribute's name of my model that have to be updated .
Now in controller, I don't know how to deal with: $pk = $POST['pk']; $name = $POST['name']; $value = $_POST['value']; $media = Media::findFirst('id="'.$pk.'"'); $media->$name=$value; <--- how to set the attribute name to be updated
thanks for help
FORGET IT : SOLVED !!!
expression above is good, I've just forgotten to put $media->save() in my controller action !!!!