If you are updating an existing object in Rails, you post to that
object (well, PUT, but hidden inside a POST) and therefore the current
state of any property of that object that you didn't include in your
post is already known, so anything you *don't* send just stays the
same, and all your changes are updated when that object is next saved.
Rails handles this through the routing mechanism, so a PUT (hidden in
a POST) to users/123 updates User#id = 123. My guess here is that if
you've gone to the trouble to disable an attribute when you show it to
the user in a form, you really aren't seriously going to consider
anything sent back by that form in any of those disabled attributes.
It's a further layer of security along the lines of Trust Nothing The
User Sends You.
If you want to show the ID to the user (for example) and you also need
to use that property within your application in order to key the form
submission to a server object, you could double-up with a hidden
element containing that data, like this:
<input type="text" disabled="disabled" name="visible_id" value="123" />
<input type="hidden" name="id" value="123" />
Rails just uses the URL for the same purpose, in keeping with the REST
methodology baked in at the platform level.
Walter
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/YLypughOWWIJ
> .
> To post to this group, send email to prototype-s...@googlegroups.com
> .
> To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
> .