*** Mateus *** wrote in post #1140030:

[...]

> The outer form is the last to be submitted(creates an Invoice) and in
> the
> meanwhile, in the inner form, I'd like to search for an Service and if
> it
> doesn't exists, I'd be rendering some field to create a service and then
> keep going on the flow.
>
> This is a many-to-many relationship
> *Invoice* ->|--------------|<- *ItemService*
>
> *Invoice* has_and_belongs_to_many
> *:item_servicesItemService* has_and_belongs_to_many *:invoices*


Hi Mateus,

It sounds like you want an "autocomplete" like functionality for that 
field, right? If so, I'd recommend using the jquery autocomplete widget:

  http://jqueryui.com/autocomplete/

There are Rails wrappers for this here (depending on what version you're 
on):

  https://github.com/crowdint/rails3-jquery-autocomplete
  https://github.com/peterwillcn/rails4-autocomplete

Does that help?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/ddf5b1eec2cc296b7611b829c30df7b3%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to