Hello,
i am using Restful since few days. i havve got problem since i try to
usre routes liltle more complicated
my routes
ActionController::Routing::Routes.draw do |map|
map.resources :users, :roles, :sessions,:jetons
UJS::routes
map.resources :faq_categories do |t|
t.resources :faqs do |t|
t.resources :votes
t.resources :comments
end
end
map.connect ‘:controller/:action/:id’
map.index ‘’, :controller => “pages”, :action => “index”
end
votes/index
-
<% @votes.each do |t| %>
- <%= h(t.ip) %> * * <%= h(t.faq_id) %> / <%= h(t.score) %> <%= link_to image_tag ('trash.png'), vote_url (:id => t, :faq_id => t.faq_id ), :method => :delete %> <% end %>
And when i test, i can see this error
ActionController::RoutingError in Votes#index
Showing app/views/votes/index.rhtml where line #4 raised:
vote_url failed to generate from {:faq_id=>“41”, :controller=>“votes”,
:action=>“show”, :id=>“1”}, expected: {:controller=>“votes”,
:action=>“show”}, diff: {:faq_id=>“41”, :id=>“1”}
Thanks all