×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: RPG
Posted by: Bartosz Walecki
Added: Sep 30, 2017 12:54 PM
Views: 6
Tags: no tags
  1. <%= form_with model: User.new do |user| %>
  2.   <%= user.text_field :name %>
  3.   <%= user.fields model: Profile.new do |profile| %>
  4.     <%= profile.text_field :age %>
  5.   <% end %>
  6. <% end %>
  7. #=>
  8. <form action="/profile" accept-charset="UTF-8" data-remote="true" method="post"><input name="utf8" type="hidden" value="✓">
  9.   <input type="text" name="user[name]">
  10.  
  11.     <input type="text" name="user[profile][age]">
  12. </form>