Hi,

Ok here's the deal. I installed the ratings plugin from CakeDC:
https://github.com/CakeDC/ratings

After doing all the steps as stated, It was fine until including this
form in my view:

<?php
echo $this->Rating->display(array(
    'item' => $post['Post']['id'],  <== line 3
    'type' => 'radio',
    'stars' => 5,
    'value' => $item['rating'], <== line 6( line 7 right below this
where the variable item is)
    'createForm' => array('url' => array($this->passedArgs, 'rate' =>
$item['id'], 'redirect' => true))));
?>

At first the errors were:
undefined variable for post and item line 3, 6 and 7.

So after modifying line 3 to $food['Food']['id'] this undefined
variable post is solved. Now the line 6 and 7 error: Undefined item
variable remain. What is the problem ?

The model I'm getting it to work is here:

mysql> describe foods;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| name        | varchar(255) | NO   | MUL | NULL    |                |
| description | varchar(255) | NO   |     | NULL    |                |
| created     | datetime     | YES  |     | NULL    |                |
| modified    | datetime     | YES  |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
5 rows in set (0.04 sec)

and the ratings table is here:

mysql> describe ratings;
+-------------+--------------+------+-----+---------+-------+
| Field       | Type         | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| id          | varchar(36)  | NO   | PRI | NULL    |       |
| user_id     | varchar(36)  | NO   | MUL | NULL    |       |
| foreign_key | varchar(36)  | NO   |     | NULL    |       |
| model       | varchar(255) | NO   |     | NULL    |       |
| value       | float(8,4)   | YES  |     | 0.0000  |       |
| created     | datetime     | YES  |     | NULL    |       |
| modified    | datetime     | YES  |     | NULL    |       |
+-------------+--------------+------+-----+---------+-------+
7 rows in set (0.04 sec)


I'm suspecting a function missing in my Controller::Food ?

Or a step is missing?

I have searched over google but find no hints or solutions to this:

http://ask.cakephp.org/questions/view/cakedc_ratings_plugin_error

Any help ?
Thanks, cheers, regards.
John Maxim
:-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to