On Monday, April 18, 2016 at 12:13:37 PM UTC-4, bot Peña wrote:
>
> On Mon, Apr 18, 2016 at 10:50 PM, fugee ohu <[email protected] 
> <javascript:>> wrote: 
> >   def move_file 
> >     from_path=params[:file_name] 
> >     to_path=params[:file_name] 
> >     to_path["queue/"]="" 
> >     FileUtils.mv "#{from_path}", "#{to_path}" 
> >     redirect_to request.referrer 
> >   end 
> > 
>
> params[:file_name], from_path, and to_path all  point to the same 
> object. to verify, check their #object_id. 
>
> so if you modify to_path, you also modify the other two. try #dup to 
> copy an object. 
>
> kind regards 
> --botp 
>

the = assignment operator assigns the values from the right side operand to 
the left side, it doesn't change the value of other variables, i dunno 
what  you mean and i dunno what #dup is ~ 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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a1055332-20cf-499a-b882-4f872905006a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to