就像标题一样,它说明了如何在控制器内使用很棒的ActiveSupport :: Testing :: TimeHelpers#travel_to方法。像在测试中一样,我想要实现以下目标:
SomethingConroller < ApplicationController
def index
travel_to some_date do
# some stuff that it depends on the current_date
end
end
end
Run Code Online (Sandbox Code Playgroud)
尝试包含模块:
include ActiveSupport::Testing::TimeHelpers
Run Code Online (Sandbox Code Playgroud)
但是我得到了:
uninitialized constant ActiveSupport::Testing
Run Code Online (Sandbox Code Playgroud)
希望日前往将被应用到view
,view_helpers
,controller_action
当我将鼠标悬停在锚标记<a>
,将border-bottom
出现从上到下,如何扭转它,因此border-bottom
从底部出现顶部?
我目前的风格:
a {
display: inline-block;
transition: border .5s ease-in-out;
}
a:hover {
border-bottom: 4px solid ;
}
Run Code Online (Sandbox Code Playgroud)