简体   繁体   English

如何使用 simple_form 将表单提交到 Rails 中的数据库?

[英]How to use simple_form to submit a form to database in Rails?

I have a blog app that uses Devise for auth.我有一个使用 Devise 进行身份验证的博客应用程序。 I want users to be able to have a profile, how would I do that using the simple_form gem?我希望用户能够拥有个人资料,我将如何使用simple_form gem 做到这simple_form

I tried:我试过:

rails g controller AuthorProfiles

rails g migration add_author_profile_to_users description:text

You can add your new parameters directly to Devise.您可以将新参数直接添加到设计中。 When the user goes to edit their profile, you can add the additional parameters there and they can fill them out or change them.当用户编辑他们的个人资料时,您可以在那里添加其他参数,他们可以填写或更改它们。 Check out the docs .查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM