【发布时间】:2012-01-02 05:41:13
【问题描述】:
我有一个路径为/user_management/edit_official/:id的网址
它对应的来自rake routes的输出是
user_management_update_official POST /user_management/edit_official/:id(.:format) {:controller=>"user_management/employees", :action=>"update_official"}
当我尝试通过表单访问url时,url没有到达,因为url/user_management/edit_official/:id变成了参数。
以下是日志文件条目?
在 127.0.0.1 开始 POST "/user_management/edit_official/31" 2012-01-02 11:05:21 +0530 由 ErrorsController#index 处理 HTML
参数:{"utf8"=>"✓", "authenticity_token"=>"DED4E/9w/GDUQdjZ27mrUWrYBgipgHnNvS8mOjdaNXU=", "员工"=>{"empl_id"=>"", "confirmation_date"=>"", "designation_id"=>"", "rep_head1_id"=>"", "payment_mode"=>"", "pf_number"=>"", "bank_name"=>"", "pt_applicable"=>"false", "reg_date"=>"", "employee_type_id"=>"", "joining_date"=>"", "rep_head2_id"=>"", "pf_applicable"=>"假", "bank_account_number"=>"", "empl_email_id"=>"false", "last_working_date"=>""}, "designation_level"=>"L-5b", "user"=>{"username"=>"dsaf.adsfas", "password"=>"[FILTERED]"}, "commit"=>"下一步", "a"=>"user_management/edit_official/31"}
这有什么原因吗。谢谢。
编辑:包括表格
<% url = user_management_update_official_path(@employee) %>
<%= form_for(@employee, :url => url, :html => { :enctype => 'multipart/form-data'} ) do |f| %>
<div id="employee_details" class="employee_form_steps">
<%= render :partial => 'user_management/employees/official_information',
:locals => { :f => f} %>
</div>
<div class="btn_row">
<%= content_tag(:button, '< Back', :id => 'official_information_back', :class => 'grey') %>
<%= f.submit 'Next', :class => 'green', :style => 'margin:0px;padding:4px;width:50px;' %>
<%= content_tag(:button, 'Cancel', :class => 'cancel grey') %>
</div>
<% end %>
【问题讨论】:
-
您在 rails 日志中得到的实际错误是什么?
-
@AndrewF,除了我复制的问题之外没有其他错误,
标签: ruby-on-rails ruby-on-rails-3