Ruby on Rails 양식에서 전달 된 매개 변수를 사용하는 Ruby 스크립트를 실행하려고합니다. 다음과 같이ruby on rails은 폼에서 루비 스크립트로 매개 변수를 전달합니다.
</div>
<div class="actions">
<%= button_to 'Apply Configs', :remote=>"true" %>
</div>
<% end %>
내 루비 스크립트의 구조는>
<%= form_for(@test, :html => {:name => "test", :id => "test"}) do |f| %>
<div class="field", id="configure_device">
<%= f.label "Label1" %>
<%= f.text_field :Form_Param1 %>
<%= f.label "Label2" %>
<%= f.text_field :Form_Param2 %>
<%= f.label "Label3" %>
<%= f.text_field :Form_Param3 %>
< ... 여기에 더 text_fields ... :
이
내에서의 코드 조각입니다def apply_configs (param1, param2, param3, ..., etc.)
<... ruby code that executes based on the values passed in param1, param2, param3 ...>
end
이 Ruby 스크립트를 별도로 테스트했는데 올바른 입력 매개 변수 인 par 매개 변수 Form_Param1, Form_Param2, Form_Param3, ...을 전달할 수있는 방법은이 Ruby 스크립트를 어떻게 실행시킬 수 있습니까? .. 등은 param1, param2, param3, ... 등으로 매핑됩니까? 당신은 params
에서받을 필요가
의 필요 어떤 대답을 수락이 없습니다. – Reactormonk