Dear all
I have been trying to get this piece of code working http://pastie.org/236978
<div class="category">
<% fields_for "daleel[categories_attributes][]", category
do |
category_form| %>
<p>
category:
<%= category_form.select "category_id",
@categories, :prompt => "category", :index => nil %>
<% if category.new_record? %>
<%= link_to_function "remove", "$
(this).up(''.task'').remove()" %>
<% else %>
<%= link_to_function "remove",
"category_for_destroy(this)" %>
<%= category_form.hidden_field :id, :index => nil %>
<%= category_form.hidden_field :should_destroy, :index
=> nil, :class => ''should_destroy'' %>
<% end %>
</p>
<% end %>
</div>
The problem is this
the select statement should hide the id however, it does not work for
select and it works for the hidden field. I was trying hard to get it
working in the past two days. I tried to put :index => nil in
the :options and :html_options and the same problem did not get
solved
this concept was gotten from http://railscasts.com/episodes/75
Thanks in advance
any idea
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---