开发者

DEPRECATION WARNING: ...Please use form_for(@resource, :as => :name) instead

Based on other posts and a Goog search, I have tried several variations to get rid of the deprecation warning but wind up with syntax errors in every case.

<%= form_for :user, @user, :url => update_reviewer_email_userhome_path do |f| %>

warning:

DEPRECATION WARNING: Using form_for(:name, @resource) is deprecated. Please use form_for(@resource, :as => :name) instead.

I'm not sure, but I'm wondering if the fact that the model is user but the view and the update action are generated by the userhome controller.

UPDATE:

When i change to the following...

<%= for开发者_运维问答m_for @user, :url => update_reviewer_email_userhome_path do |f| %>

I got this error...

No route matches "/userhome/19/update_reviewer_email"

until i changed the route from post to put:

  resources :userhome, :except => [:show, :new, :edit, :update, :destroy]  do
    member do
      put :update_reviewer_email
    end
  end

Thanks!


You can get rid of the :user part:

<%= form_for @user, :url => update_reviewer_email_userhome_path do |f| %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜