What i have: A table generated by single cells of values like:
<tr>
<%= render :partial => 'partials/fieldtypes/show_in_table', :locals => {:fieldtype => 'textline', :data => {'object' => object, 'value' => 'name'}, :vars => {'textline' => object.name}} %>
<%= render :partial...
</tr>
The partial looks like this:
<td class='tablecell' <% data.each do |dat| %>data-<%= raw(dat[0]) %>='<%= raw(dat[1]) %>' <% end %> >
<%= render :partial => 'partials/fieldtypes/show/'+fieldtype, :locals => {:vars => vars} %>
</td>
Now i want to edit single entries/cells of that table like in MS Excel by doubleclicking on them. The site is running on full javascript, so pages are not being linked.
So what i want is: Generating (not prerendering and switching visibility!) a form everytime the user wants to edit a field (by doubleclicking).
My ideas so far: As you can see i was trying to store all the necessary data in html5 data-tags to generate the form. The plan was to call a controller action everytime a cell is doubleclicked and to generate the form with the database connection with rails.
Problem/Question: Does this work that way? Because the data in the tags looks converted and useless for further interaction. And if it works: How do i create a controller action for that with a proper route?
Or are there any easier solutions? As stated i do not want to render the form hidden directly!