fix routes
This commit is contained in:
parent
e2e9582211
commit
c986683273
4 changed files with 4 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
<footer class="footer">
|
||||
<small>
|
||||
<a href="#">Tab</a>
|
||||
<%= link_to "Tab", root_path %></a>
|
||||
by <a href="#">Zeus WPI</a>
|
||||
</small>
|
||||
<nav>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<!-- tot hier -->
|
||||
<% end %>
|
||||
|
||||
<%= form_for( @order, url: orders_user_path(@user)) do |f| %>
|
||||
<%= form_for( @order, url: user_orders_path(@user)) do |f| %>
|
||||
<%= f.submit "Order", class: "btn btn-primary " %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<ul class="users">
|
||||
<% @users.each do |user| %>
|
||||
<li>
|
||||
<%= link_to user.name , orders_new_user_path(user) %>
|
||||
<%= link_to user.name , new_user_order_path(user) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -3,11 +3,7 @@ Rails.application.routes.draw do
|
|||
root "users#index"
|
||||
|
||||
resources :users do
|
||||
member do
|
||||
get 'orders/new'
|
||||
post 'orders' => 'orders#create'
|
||||
|
||||
end
|
||||
resources :orders, only: [:new, :create]
|
||||
end
|
||||
|
||||
resources :products
|
||||
|
|
Loading…
Reference in a new issue