Hello. So solved some error with just replacing path method with calling
:action=>…
But I’m curious why in absolutely same in first case _path worked
perfect,
in second it causer an error which is solved just by changing syntax
(but
not the sence of what is happening)
First case:
<%= form_for @answer, {:url => create_answer_test_path(@test), :html =>
{:id=>“form_#{@key.position}”}, :remote=>true}
worked with no problem
<%= button_to ‘-’, {:url=>delete_answer_test_path(@test)},
:method=>:delete, :remote =>true %>
Caused several types of errors:
ActionController::RoutingError (No route matches
{:action=>“delete_answer”,
:controller=>“tests”, :id=>nil})
Started DELETE
“/tests/150/create_answer?key_id=905&url=%2Ftests%2F150%2Fdelete_answer”
for 127.0.0.1 at 2013-03-18 12:08:36 +0400 (??? for some reason started
previous method and ‘delete_answer’ was just in server call)
But when I replaced it with {:controller=>‘tests’, :action =>
‘delete_answer’} (which is basically just another way of syntax, but not
of
what is going on) works fine.
?