This commit is contained in:
ohsab 2014-11-26 12:01:22 +01:00
commit a52c50531e
2 changed files with 28 additions and 1 deletions

View file

@ -1,5 +1,5 @@
class Order < ActiveRecord::Base
belongs_to :users
belongs_to :user
has_many :order_products
has_many :products, through: :order_products

View file

@ -0,0 +1,27 @@
<h1>Update user</h1>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<%= form_for(@user) do |f| %>
<%= render partial: 'errors', locals: { model: @user } %>
<%= f.label :nickname %>
<%= f.text_field :nickname %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :last_name %>
<%= f.text_field :last_name %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.label :password_confirmation, "Confirmation" %>
<%= f.password_field :password_confirmation %>
<%= f.submit "Save changes", class: "btn btn-primary" %>
<% end %>
</div>
</div>