Hi,
I'm a newbie so bare with me;
I have a 'main'-erb that renders a 'sub'-erb. The 'sub'-erb consist of
a tablerow that are populated with data. The data can be changed in
three cases defined by text_field_tag:s. This is ensembled inwith a
form and the identity of the form (the :id) are defined by a variable.
The forms :remote is set to true cause I want to use some effects on
the changed row.
How is it possible to retrieve the values that the user has changed in
the defined text_field_tag:s? and send them to the defined action?
The 'main'-erb:
....
<% @bgcolour="lightblue" %>
<% @calculate.calculate_rows.each do |r| %>
<% if @bgcolour.eql?("lightblue") %>
<% @bgcolour="lightgrey" %>
<% else %>
<% @bgcolour="lightblue" %>
<% end %>
<% @calculate_row = r %>
<% @row = @calculate_row.read_attribute(:id).to_s %>
<%= render :partial => @calculate_row %>
<% end %>
</table>
The 'sub'-erb:
<tr align=left bgcolor="<%= @bgcolour %>" id="row_<%= @row %>">
<td width=0% bgcolor="white"><%= form_tag( { :action
=> :update, :controller => :calculate_rows, :id=>@row}, :method
=> :get, :id => "cr"+@row, :remote => true) do %> </td>
<td width=4%><font size="-2"><%= @calculate_row.lagdat %></
td>
<td><font size="-2"><%= @calculate_row.utlev %></td>
<td><font size="-2"><%= @calculate_row.fsnr %></td>
<td width=3%><font size="-2"><%= @calculate_row.refnr %></td>
<td><font size="-2"><%= @calculate_row.mottnamn %></td>
<td><font size="-2"><%= @calculate_row.mottpadress %></td>
<td><font size="-2"><%= @calculate_row.kli %></td>
<td><font size="-2"><%= @calculate_row.vikt %></td>
<td><font size="-2"><%=
number_with_precision(@calculate_row.skrymme, :precision => 2) %></td>
<td><font size="-2" color="blue"><%= @calculate_row.fraktvikt
%></td>
<td><font size="-2"><%= @calculate_row.hub %></td>
<td><font size="-2"><%= text_field_tag(:fraktbrutto,
@calculate_row.fraktbrutto, {:size => 3, :placeholder => "0", :value
=> @calculate_row.fraktbrutto}) %></td>
<td><font size="-2"><%= text_field_tag(:privatlev,
@calculate_row.privatlev, {:size => 3, :placeholder => "0", :value =>
@calculate_row.privatlev }) %></td>
<td align="right"><font size="-2"><%=
number_with_precision(@calculate_row.justering, :precision => 2) %></
td>
<td align="right"><font size="-2"><%=
text_field_tag(:matafrakt, @calculate_row.matafrakt, {:size =>
3, :placeholder => "0", :value => @calculate_row.matafrakt}) %></td>
<td align="right"><font size="-2"><%=
number_with_precision(@calculate_row.kostOT, :precision => 2) %></td>
<td align="right"><font size="-2"><%=
number_with_precision(@calculate_row.privatlevOT, :precision => 2) %></
td>
<% if (@calculate_row.resultat.nil?) %>
<td align="right"><font size="-2"><%=
number_with_precision(@calculate_row.resultat, :precision => 2) %></
td>
<% elsif(@calculate_row.resultat > 0)%>
<td align="right"><font color=green size="-2"><%=
number_with_precision(@calculate_row.resultat, :precision => 2) %></
td>
<% else %>
<td align="right"><font color=red size="-2"><%=
number_with_precision(@calculate_row.resultat, :precision => 2) %></
td>
<% end %>
<td><font size="-2"><%= submit_tag "Save" %></td>
<% end %>
</tr>
I'm really stucked so any pointers are appreciated.
Br,
Niclas
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.