Displaying 4 results from an estimated 4 matches for "link_to_add".
2011 Feb 26
1
How to manage the form of a model that has two foreign keys
...gt;
<%= godfather_form.label :description %>
<%= godfather_form.text_field :description %>
<%= godfather_form.link_to_remove "Remove this
godfather" %>
<% end %>
<%= f.link_to_add "Add a godfather", :godfathers %>
<br/><br/>
<%= f.submit "Update Godfathers" %>
So as I said in the comments, my goal is to be able to provide a
username for the godfather instead of an id. That username is a column
in the User table by the way.
Any...
2011 Jul 16
0
nested_form gem don't work for accepts_nested_attributes_for :limit
...elds_for :images do |i| %>
<% if i.object.new_record? %>
<%= i.file_field :photo %>
<% else %>
<%= image_tag(i.object.photo.url(:thumb)) %>
<% end %>
<%= i.link_to_remove "Remove this image" %>
<% end %>
<%= f.link_to_add "Add a Image", :images %>
<%= f.submit %>
<% end %>
The problem is when I add more images that the limit. Although I
delete it before submit the form, the post don''t validate:
ActiveRecord::NestedAttributes::TooManyRecords. For example, if I may
have 2 limit ima...
2013 Feb 10
0
Nested attributes doesnt get updated
...lass="field">
<label><b>*Needed By</b></label>
<%= f.date_select :needed_by, :default => 2.days.from_now %>
</div>
<%= render :partial => ''w_a_details/form'',:locals => {:form => f} %>
<p><%= f.link_to_add "Add Request", :w_a_details %></p>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
*w_a_details/_form.html.erb
*<%= form.fields_for :w_a_details do |a_form| %>
<%=a_form.text_field :description %>
<%=...
2011 Oct 26
6
Add an index to a form
Hello,
I''m having some trouble with forms, my app allows to enter data by
using a multi-step form that has 7 steps.
There are 3 steps that may let the user to add 1 form, for example
there''s a step called "children"
and that children has the following fields:
* name
* age
* gender
but one father may have more than 1 child and I''m adding another form
with