Ruby on Rails Monday, April 18, 2016



On Monday, April 18, 2016 at 3:53:44 PM UTC-4, Colin Law wrote:
On 18 April 2016 at 19:07, fugee ohu <fuge...@gmail.com> wrote:
> ...
> how can changing to_path affect the value of from_path ?

Because, as botp pointed out, they are referencing (pointing to) the
same object in memory.
Use
to_path = some function of params[....]
to avoid the problem.  In a previous post you said you did not know
what dup does.  Perhaps you should find out.

Colin

got it working using dup ~ thanks, fugee

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f702a5ff-7e81-4f01-8673-b7834e75b03f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment