2
這裏是設計「註冊」視圖(new.html.erb)。如何設計知道你想要表格數據寫入哪張表?
<h2>Sign up</h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
<div><%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %></div>
<div><%= f.submit "Sign up" %></div>
<% end %>
<%= render "devise/shared/links" %>
我有一個名爲'用戶'的表,我希望數據去。當我在我的系統上創建一個帳戶時,數據會寫入我的用戶表中,並且這一切都完美無缺。但設計怎麼知道我想要數據去'用戶'?
儘管我已經開始掌握軌道,但符號:密碼,電子郵件等與數據庫輸入等同嗎?這是否與設計的源代碼,而不是軌道?