我有一个有时会工作有时不工作的表格,除了重新启动 rails 应用程序之外,我无法弄清楚时间之间发生了什么变化。目前它不工作。
我的路由文件中有这些条目:
constraints :subdomain => 'my' do
namespace 'my', path: nil do
namespace 'author' do
resources :test_author do
resources :steps_author
[...]
end
end
end
end
我在这里感兴趣的特定路线从rake routes
my_author_test_author_steps_author GET /author/test_author/:test_author_id/steps_author/:id(.:format) my/author/steps_author#show {:subdomain=>"my"}
PUT /author/test_author/:test_author_id/steps_author/:id(.:format) my/author/steps_author#update {:subdomain=>"my"}
DELETE /author/test_author/:test_author_id/steps_author/:id(.:format) my/author/steps_author#destroy {:subdomain=>"my"}
我的表单打开看起来像这样(使用简单的表单和引导程序):
<%= simple_form_for @step, :url => my_author_test_author_steps_author_path(@step), :html => { :class => 'form-horizontal' } do |f| %>
任何人都可以对正在发生的事情有所了解吗?
更新
根据 juanpastas 的帮助,表单似乎正确呈现,但是 Rails 将请求解释为 POST 而不是 PUT。虽然对于我的生活,我无法弄清楚为什么。