On Aug 12, 10:56 am, Ruby on Rails <[email protected]>
wrote:
> I am facing strange problem.
>
> I have an object �...@part=mainpart.find(:all)
>
> 1. �[email protected]_with_index do |mainpart,index|
> 2. <p><%= mainpart.object_id%></p>
> 3. end
>
> Here problem is that object_id is reserved for rails. Here
It's not just reserved by rails, it is a fundamental ruby method. You
can get the attribute value with read_attribute or [] (which are the
same thing. You could add your own object_id accessor but I'm not sure
whether you would be storing up trouble for later ( object_id is also
available as __id__ but other code might not be expecting object_id to
have been overridden)
Fred
> object_id field in my table . Now i want to get value <%=
> mainpart.object_id%> is giving GARBAGE VALUE. Is there any solution
> apart from removing/change object_id field
> from table .
>
> Thanks,
> Angela .
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---