On Mon, Apr 18, 2016 at 10:50 PM, fugee ohu <[email protected]> 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

-- 
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/CAAwHHQi9chVXUSNWbbn5dWESct1XyfMKVgvUEf7wTsPr3gjeWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to