如果没有在Rails 3中重新加载,数据库值不会出现在同一页面中
我希望在按收据编号搜索后,值应显示在同一页面中,而不使用Rails3重新加载页面。 但我得到了所有的价值,但不是在同一页面。 有人可以帮我解决这个问题吗? 我在下面解释我的代码。
意见/家庭/ home.html.erb
(E-RECEIPT)
{:action => "scan_report" },remote: true do |f| %> Receipt No. Scan : "form-control",placeholder:"Receipt No. scan",:onchange => 'this.form.submit();' %>
控制器/ homes_controller.rb:
class HomesController "home" end end end
scan_report.js.erb
$("#hcsy_block").html(""); $("#hcsy_block").slideDown(350);
hcsy_output_table.html.erb
Harischandra Sahayata Yojana Form
Personal Details
Receipt No : <input type="text" class="form-control" value= "" > Date & Time : <input type="text" class="form-control" value= "" > Name of Deceased : <input type="text" class="form-control" value= "" > Mobile No : <input type="text" class="form-control" value= "" > Beneficiary Name : <input type="text" class="form-control" value= "" > Occupation : <input type="text" class="form-control" value= "" > Relation with Deceased : <input type="text" class="form-control" value= "" > Address Line - I : Address Line - II : Village/City : <input type="text" class="form-control" value= "" > Block : <input type="text" class="form-control" value= "" > District : <input type="text" class="form-control" value= "" > State : <input type="text" class="form-control" value= "" > Country : <input type="text" class="form-control" value= "" > Police Station : <input type="text" class="form-control" value= "" > Annual Income From Sources
BPL : <input type="text" class="form-control" value= "" > Govt. Services : <input type="text" class="form-control" value= "" > Business : <input type="text" class="form-control" value= "" > Land Property : <input type="text" class="form-control" value= "" > Others : <input type="text" class="form-control" value= "" > Application Details
Select Purpose : <input type="text" class="form-control" value= "" > Amount Required : <input type="text" class="form-control" value= "" > Has he/she received any assistance earlier from this fund Status : <input type="text" class="form-control" value= "" > Prev. Receipt No. : <input type="text" class="form-control" value= "" > Amount Received : <input type="text" class="form-control" value= "" > Date of Received : <input type="text" class="form-control" value= "" > " border="0" name="signature" height="140" class="borderblackdiv"> Deceased Photo " border="0" name="signature" height="140" class="borderblackdiv"> Donor Photo Donor Thumb
scan_report.html.erb
我需要_hcsy_output_table.html.erb
应该在表单之后在同一个主页上呈现它应该没有重新加载页面意味着当用户将提交表单将提交的收据号码时突然显示所有值。 请帮我解决这个问题。
Interesting Posts
Rails 3:如何进行Ajax调用?
Google Maps for Rails – 使用AJAX更新标记
在rails中提供静态JSON目标文件
Rails AJAX:我的部分需要一个FormBuilder实例
使用Ajax更新Rails中的元素
fullcalendar将js变量传递给rails,反之亦然
多次回复一个请求?
rails 4 bootstrap 3 ajax modal
ActionController :: UnknownFormat with format.js for ajax implementation(Rail 4)
在ajax请求中的rails中的Gettin 500内部服务器错误