public function update($panel_name, $id)
 {
     $panel = new Panel();
     $panel_data = $panel->get_record_for($panel_name, $id, $this->subpanel_parent);
     $method = 'U';
     if (!$panel_data || !$panel_data['data']) {
         return Redirect::back()->with('error', 'You do not have access to that area.');
     }
     $this->init($panel_name, $method, $id);
     $title = 'Edit This ' . $this->single_item_name;
     $title .= $this->primary_element_value ? ' for "' . $this->primary_element_value . '"' : '';
     $panel_data_with_count = $panel->get_data_for($panel_name, TRUE);
     $adjacents = $panel->adjacents_for($id, $panel_name);
     View::share('adjacents', $adjacents);
     View::share('curr_record_id', $id);
     View::share('n_items_in_panel', $panel_data_with_count['data']);
     View::share('passed_model', $panel_data['data']);
     View::share('page_title', $title);
     View::share('method', $method);
     View::share('layout_title', $title);
     View::share('form_action', $this->base_uri . 'panel/' . $this->name . '/update/' . $id . $this->append_form_action);
     View::share('form_method', 'PUT');
     View::share('form_purpose', 'update');
     View::share('submit_value', 'Save this ' . $this->single_item_name);
     return $this->render('form', $panel_data, $method);
 }