【发布时间】:2018-06-01 19:31:16
【问题描述】:
我有:
= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post}) do |f|
= f.error_notification
.input-row
= f.input :email, :required => false, :autofocus => true, placeholder: "Enter your email address", :
.submit-row
.row
.col-xs-2
.cancel
- if resource_name == :admin
= link_to "Cancel", new_admin_session_path
- else
= link_to "Cancel", new_client_session_path
.col-xs-10
= f.submit "Reset Password", :class => "btn btn-primary"
我也有 params[:type] 我想将它传递到下一页,这是一个生成的电子邮件,位于 app/views/accounts_mailer/reset_password_instructions.html.haml 中(我不知道怎么知道那是它去了)
问题是:我如何在那里获得其他信息,以及如何在那里访问它?
【问题讨论】:
-
如果可以显示它,您可以将其添加为表单中的隐藏字段,以便与表单中的所有其他参数一起传递。然后您可以在相应控制器的 params 哈希中访问它。如果您需要在其他地方访问它并且它是特定于用户的,您可以随时将其添加到会话哈希中。
-
我该怎么做?
-
我会回答的。
标签: ruby-on-rails devise haml simple-form-for