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
<ul>
<% @votes.each do |t| %>
<li><%= 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 %>
</li>
<% end %>
</ul>
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---