Rails ruby-china 源码有个地方看不懂

zhangwankai · September 05, 2012 · Last by mobiwolf replied at September 06, 2012 · 2446 hits

大家好,我看着 github 上的 ruby-china 源码学习 rails。 topics_controller.rb 文件中

class TopicsController < ApplicationController
  ......
  def set_menu_active
    @current = @current = ['/topics']
  end
  ......
end

请问为什么要连续两次对 @current 赋值呢,这不是多此一举吗,还是另有深意

求解答,谢谢

你可以自己去掉试试看啊

我也看不懂,求解释 @xdite

不会是写错了吧。

我猜是 git 自动 merge 产生的

#5 楼 @rociiu git log -S '@current = @current'

不小心寫兩次

@xdite 我一直以为有神马特别之处,一直找不到原因。哈哈,原来如此啊。

You need to Sign in before reply, if you don't have an account, please Sign up first.