On Friday 07 April 2006 12:02, Alana wrote:
If I can override it, does every instance of ‘id’ become ‘TblUsersID’?
Thank you in advance!
In every model, you can execute set_primary_key. So, for your
When you have done that, you can call .id on your objects, because it
the primary key. Calling “tbluserid” as you did in your example is not
necessary (it won’t even work I guess, mostly because it should be
TblUsersID…), the primary key is always “id”.
And, it is indeed case sensitive. You could have tried that out easily
BTW, you don’t have to specify the HTML tags for the form and fields
If you make use of the helpers (like “text_field”), it creates the
HTML for you. Also, if you adhere to the standard naming convention,
the data becomes much easier. The text_field method for example takes as
first two arguments the object and the method. If for example you use
and object and “title” as method, it will create a textfield
way, when you have a lot of textfields for the object post, you can
“post.attributes = @params[“post”]”, to have them assigned all at once.
guess the latter you already knew, looking at your code.
See http://api.rubyonrails.com/ for more info on the details of the