我正在使用Rails做一些概念证明。我创建了一个客户,并向其申请了DEVISE。 Everythig工作正常,但现在我正在尝试与客户一起登录并直接进入他的范围。 本地主机:3000 /客户/ 1 在此之后,使用某些单词隐藏/ customers / 1,例如:myProfile。
我试图用
做第一部分模块ApplicationHelper
保护
def after_sign_in_path_for(resource)
#path重定向
结束
结束
我正在尝试使用routes.rb中的定义
redirect_to(customers_path)
或类似的东西:
@customer= Customer.find_by_email(current_customer.email)
redirect_to(customer_path(@customer))
但还没有任何工作。
我不确定如何将消息发送到服务器的控制台(就像在Java中使用一些System.out.println一样)来检查内容......
非常感谢!