错误:
No route matches "/en/member/update_profile"
edit_profile.html.haml:
=simple_form_for @m, :url => member_update_profile_path do |f|
浏览器中的:
<form accept-charset="UTF-8" action="/en/member/update_profile" class="simple_form user" id="edit_user_1508" method="post">
member_controller_test.rb(成功)
post "update_profile"
rake routes:
member_update_profile POST /:locale/member/update_profile(.:format) {:controller=>"member", :action=>"update_profile"}
答案 0 :(得分:0)
结果是simple_form_for和rails不在同一页面上,请参阅下面的“put”:
<form accept-charset="UTF-8" action="/en/member/update_profile" class="simple_form user" id="edit_user_1508" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="_method" type="hidden" value="put">
<input name="authenticity_token" type="hidden" value="AYxvKwu+qH7vjup1h4/TlGBbvg2M10koPdJDNk2xuOw=">
</div>
使用此修复它:
=simple_form_for @m, :url => member_update_profile_path, :html => {:method => :post} do |f|