fix routes

This commit is contained in:
Benjamin Cousaert 2014-11-25 16:38:08 +01:00
parent e2e9582211
commit c986683273
4 changed files with 4 additions and 8 deletions

View file

@ -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>

View file

@ -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 %>

View file

@ -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>

View file

@ -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