How to embed node edit form on page? module_load_include('inc', 'node', 'node.pages'); 

$form_id = 'reviewer_rating_node_form';

global $user;
$rating_id = views_get_view_result('get_rating', 'default', $nid, $user-&gt;uid);

// Rating hasn't been created yet. Create one.
if (empty($rating_id)) {
    // add node properties
    $newRating = new StdClass;
    $newRating-&gt;type = 'reviewer_rating';
    $newRating-&gt;title = $user-&gt;name . "'s rating of " . $nid;
    $newRating-&gt;uid = $user-&gt;uid;
    $newRating-&gt;created = strtotime("now");
    $newRating-&gt;changed = strtotime("now");
    $newRating-&gt;status = 1;
    $newRating-&gt;comment = 0;
    $newRating-&gt;promote = 0;
    $newRating-&gt;moderate = 0;
    $newRating-&gt;sticky = 0;

    // add CCK field data
    $newRating-&gt;field_rating_application[0]['nid'] = $nid;
    $newRating-&gt;field_rating_reviewer[0]['uid'] = $user-&gt;uid;

    // save node
    node_save($newRating);
}

$rating_node = node_load($rating_id[0]-&gt;nid);

$output = drupal_get_form('reviewer_rating_node_form', $rating_node);   
return $output;


This isn't working for me. If I dpm $rating_node it looks correct, but when I call drupal_get_form I get this error:

Fatal error: Cannot unset string offsets in includes\form.inc on line 498


If I log the $form variable at that line it's a string that starts with this: 

Aform action="/devsite/node/423"  accept-charset="UTF-8" method="post" id="node-form" enctype="multipart/form-data"&gt;
&lt;div&gt; 


That "A" instead of a "&lt;" might be a clue. I have no idea.

Any suggestions on what I'm doing wrong here?
Why don't you use Editview module? You can create an editview with a block display and show it on your page to edit your nodes from there.