[英]how to get time range from impressionist rails?
我知道這很難,但是...我正試圖計算從上次發布日期到time.now在特定時間的impressionist gem
觀看impressionist gem
,並且由於此消息的出現,下面的代碼似乎不起作用?
參數數目錯誤(給定0,應為1..2)
<%= @user.impressionist_count(:filter=>:ip_address, :start_date=>"#{current_user.posts.last.created_at.strftime("%Y-%m-%d")}", :end_date=>"#{t.strftime("%Y-%m-%d")}") %>
后控制器:
def show
@user = current.user
@post = Post.new
end
用戶模型:
is_impressionable
has_many posts
這應該正常工作。
<%= @user.impressionist_count(:filter => :ip_address, :start_date =>
current_user.posts.last.created_at.strftime('%Y-%m-%d'), :end_date =>
t.strftime('%Y-%m-%d')) %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.