结构如下所示:
if country.state country.state.name end
这似乎是一个经典的案例,用country.state重复自己在一个简单的块中出现两次.有没有办法干这个?
我认为语法是
country.try(:state).name