just add the onchange="this.form.submit();" like you would normally,
since you aren''t using the form helpers properly to build the select
box. It will have to be within a <form> tag though
You can add your ajax to the onsubmit handler of the form tag.
Seriously, though, this is not good rails development, please check
out the "best practice" ways to do things like this before hacking
your own solutions. It''s not PHP!
http://www.authomedia.co.uk/dev/repairs.zip
Joe
On Jan 8, 9:51 pm, John Smith
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Is is necessary to have a button here?
>
> <p>
> <b>Repuestos</b><br />
> <select name="repair_ticket[rp_item]">
> <% @rp_parts.each do |rp_part| %>
> <option value="<%= rp_part.id %>"
> <%= '' selected'' if rp_part.id ==
@repair_ticket.rp_item %>>
> <%= rp_part.name%>
> </option>
> <% end %>
> </select></p>
>
> I want to capture @repair_ticket.rp_item without a button.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---