I am trying to call the 'update' method from 'ROOT_RAILS/controllers/users/account_controller.rb'
...
end
def update
...
end
def ...
using a "form_tag' in '/ROOT_RAILS/views/users/accounts/account.rb:
<% form_tag ( users_account_path, :method => :post ) do %>
<%= text_field_tag :name %>
<%= text_field_tag :surname %>
<%= submit_tag_tag "Update" %>
<% end %>
and having a namespace in 'ROOT_RAILS/config/routes.rb'
...
namespace "users" do
resources :accounts do
collection do
...
end
end
end
...
When I try to submit this form, I have a
No route matches "/users/accounts/2"
What am I wrong?
In 'form_tag' I tryed
:controller => "users/accounts", :action => "update"
instead of
users_account_path
that I think is the same.
If I use an ActiveRecord form works:
<%= f开发者_开发知识库orm_for(@account, :url => { :action => "update", :controller => "accounts" } }) do |f| %>
...
Have you tried:
users_accounts_path
精彩评论