0

有没有更好的方法在 Rails 中使用 wicked gem 来做到这一点?

def finish_wizard_path
  public_send("#{controller_name}_path", current_user.try(controller_name.intern).id)
end
4

1 回答 1

2

这可以通过使用url_for方法来完成

url_for(controller: controller_name, action: :new, id: current_user.id)
于 2019-08-29T12:35:14.107 回答