Show
Ignore:
Timestamp:
01/10/06 09:43:07 (6 years ago)
Author:
john
Message:

finished the scaffolding stuff in AR and its helper

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_view/helpers/active_record_helper.php

    r107 r110  
    5757        $contents .= $this->all_input_tags($record, $record_name, $options); 
    5858        if(isset($options['block'])) $contents .= eval($options['block']); 
    59         $contents .= submit_tag($submit_value); 
     59        $contents .= "<br>".submit_tag($submit_value)."<br><br>"; 
    6060 
    6161        return $this->content_tag('form', $contents, array('action' => $action, 'method' => 'post')); 
     
    9090        if(is_object($object_name)) { 
    9191            $object_name = get_class($object_name); 
    92             echo "object name:".$object_name; 
     92            //echo "object name:".$object_name; 
    9393        } 
    9494        $this->object_name = $object_name; 
     
    104104                $this->content_tag("p", "There were problems with the following fields:") . 
    105105                $this->content_tag("ul", array_reduce($object->errors, create_function('$v,$w', 'return ($v ? $v : "") . content_tag("li", $w);'), '')), 
    106                 array("id" => (isset($options['id']) ? $options['id'] : "errorExplanation"), "class" => (isset($options['class']) ? $options['class'] : "errorExplanation")) 
     106                array("id" => (isset($options['id']) ? $options['id'] : "ErrorExplanation"), "class" => (isset($options['class']) ? $options['class'] : "ErrorExplanation")) 
    107107            ); 
    108108        } 
     
    116116            //$contents .= Inflector::humanize($column['name']) . ":</label><br />"; 
    117117            //$contents .= input($record_name, $column['name']) . "</p>\n"; 
    118             eval($input_block) . "\n"; 
     118            if(!in_array($column['name'], $record->primary_keys)) { 
     119                eval($input_block) . "\n";     
     120            }          
    119121        }  
    120122        return $contents;