Rendering partial to a table row with form_tag is getting crazy!

I have a table 23 (column) x6 (row) and a row change using the link_to_remote function. each tag has its own id attribute.

change the action of changing the channel call and change the action by changing the line using the partial render function.

_change.html.erb

<td id="row_1">1</td>
.
.
omitted
.
.
<td id="row_23">23</td>
Function

link_to_remote

<%= link_to_remote 'Change', :update => 'row_1', :url => change_path %>

change action

def change
  logger.debug render :partial => 'change'
end

If I encoded as above, everything works fine. This means that all changed columns are on the same row.

But, if I complete the partial code with the form_for function, as shown below ...

<% form_for 'change' do %>
<td id="row_1">1</td>
.
.
omitted
.
.
<td id="row_23">23</td>
<% end %>

Then one column located on one row, and this column is the first column. I was looking for a log file, but these were regular html tags.

What's wrong?

alt text

+3
2

HTML, . td, form. .

0

remote_form_for ajax

<% remote_form_for 'change' do %>

<% form_for 'change' do %>
0

Source: https://habr.com/ru/post/1750631/


All Articles