form_for フォーム ヘルパーがあります。
= form_for([@search, @search_request], url: {action: @search_form[:search_action]}, method: @search_form[:http_method], remote: true, html: {id: @search_form[:html_id]}, data: {type: "json"}) do |search_current_form|
- @search_params.each do |search_param|
= render partial: "search/search_param", locals: {search_param: search_param, search_form: @search_form, search_current_form: search_current_form, search_request: @search_request}
部分的にsearch/search_param
:
.input-group
span.input-group-addon
= search_current_form.check_box(:search_request, :#{"enable_" + search_param[:name]}, {class: "param_enabled_checkbox"}, true, false)
= search_current_form.text_field(:search_request, :#{"param_" + search_param[:name]}, {class: "param_value_input"})
しかし、私はエラーが発生します:
SyntaxError
Showing ./app/views/search/_search_param.html.slim where line #19 raised:
./app/views/search/_search_param.html.slim:19: syntax error, unexpected ';', expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
; @output_buffer.safe_concat((...
^
./app/views/search/_search_param.html.slim:20: syntax error, unexpected ';', expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
; @output_buffer.safe_concat(("</div></td></tr>")); @output_buffer
^
./app/views/search/_search_param.html.slim:21: syntax error, unexpected keyword_ensure, expecting ')'
./app/views/search/_search_param.html.slim:23: syntax error, unexpected keyword_end, expecting ')'
何が問題なのですか?次の引数の数が間違っています:
= search_form.text_field(:search_request, :#{"param_" + search_param[:name]}, {class: "param_value_input"})
? この行は、「抽出されたソース (行 #19 付近):」で赤色です。