Yes, normally you'd use a form, select and submit button instead of a
create-button if you actually wanted the create-button to reference a
select. However, as you noted, you cannot nest one form inside each
other. However, you can use "hjq-formlet" from hobo-jquery inside a
form. hjq-formlet only works with AJAX, but since that's what you want...
Bryan
Montgomery Kosma wrote:
> Trying to use create-button to add a project/custodian pair to my
> ProjectCustodian has_many :through table.
>
> Here's my create button:
>
> <create-button class="ui-icon ui-icon-circle-plus"
> model="ProjectCustodian"
> update="project-custodians-section"
> fields="{project_id => #{this.project_id},
> custodian_id => ??? }"/>
>
> Seems like a simple question -- how do I tell it to use the
> custodian_id from the nearby select?
>
> Here's the section of the form:
>
> <after-header: class="add-to-association">
> <%
> options = Custodian.all.select {|x| can_view?(x)}
> values = this.*.custodian
> -%>
> <select merge-attrs="&{:disabled => disabled}">
> <option value="">Add Custodian</option>
> <option repeat="&options.sort_by {|x| x.to_s.downcase}"
> value="@#{this.id}"
> merge-attrs="&{:disabled => 'true'} if this.in?
> (values)"><%= h this.to_s %></option>
> </select>
> <create-button class="ui-icon ui-icon-circle-plus"
> model="ProjectCustodian"
> update="project-custodians-section"
> fields="{project_id => #{this.project_id},
> custodian_id => ??? }"/>
> </after-header:>
>
>
> Afterthought: I also tried using the Agility tutorial's autocomplete
> approach inside <form:project_custodian.new ... > - but couldn't get
> that working. Is that because an embedded <form> inside another
> <form> tag is illegal?
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---