Rails 中实际提交的占位符 [英] Placeholder in Rails that will actually submit

查看:28
本文介绍了Rails 中实际提交的占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在 Rails 表单中创建占位符,但是有没有办法在其中放入一些实际提交的内容?类似于 <%= f.email_field, :email, (element here): <%= current_user.email %>%> 帮助将不胜感激.如果您有任何问题,请告诉我.

I know how to make a placeholder in a rails form, but is there a way to put something in it that will actually submit something? Something like <%= f.email_field, :email, (element here): <%= current_user.email %> %> Help would be much appreciated. Let me know if you have any questions.

推荐答案

只需添加一个值,它就可以如您所愿.下面的例子

Just adding a value it should work as you want. Example below

<%= f.email_field, :email, value: current_user.email %>

这篇关于Rails 中实际提交的占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆