SimpleForm without for (non model form)

前端 未结 5 1925
情书的邮戳
情书的邮戳 2020-11-30 21:57

Is it possible to use Simple Form (by: Plataformatec) without a model?

https://github.com/plataformatec/simple_form

5条回答
  •  情深已故
    2020-11-30 22:49

    You can use :symbol as the first argument.

    <%= simple_form_for :user, url: users_path do |f| %>
      <%= f.input :name, as: :string %>
      ...
    <% end %>
    

    It will output something like this:

    ...
    ...

提交回复
热议问题