accounts ac , opportunities o where o.id = '27032' and o.account_id =
ac.id and cts.account_id = o.account_id))
2011-05-05 13:06:42 -0300#<ActiveRecord::StatementInvalid:
Mysql::Error: Subquery returns more than 1 row: SELECT * FROM
`contacts` WHERE ((select cts.id from contacts cts, accounts ac ,
opportunities o where o.id = '27032' and o.account_id = ac.id and
cts.account_id = o.account_id)) > -- on the ActiveScaffold column
= :contacts in OpportunityRevisionsController
ActionView::TemplateError (Mysql::Error: Subquery returns more than 1
row: SELECT * FROM `contacts` WHERE ((select cts.id from contacts cts,
accounts ac , opportunities o where o.id = '27032' and o.account_id =
ac.id and cts.account_id = o.account_id)) ) on line #8 of vendor/
plugins/active_scaffold/frontends/default/views/
_form_attribute.html.erb:
5: </dt>
6: <dd>
7: <%= active_scaffold_input_for column, scope %>
8: <% if column.options.is_a?(Hash) &&
column.options[:update_column] -%>
9: <%= loading_indicator_tag(:action => :render_field, :id =>
params[:id]) %>
10: <% end -%>
11: <% if column.description.present? -%>
app/helpers/items_helper.rb:17:in `options_for_association'
vendor/plugins/active_scaffold/frontends/default/views/
_form_attribute.html.erb:8
vendor/plugins/active_scaffold/frontends/default/views/
_form.html.erb:15:in `block in
_run_erb_vendor47plugins47active_scaffold47frontends47default47views47_form46html46erb_locals_columns_form_object'
vendor/plugins/active_scaffold/frontends/default/views/
_form.html.erb:3
vendor/plugins/active_scaffold/frontends/default/views/
_create_form.html.erb:42
On May 5, 8:02 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Jueves, 5 de Mayo de 2011 05:16:47 Bernardo escribió:
>
>
>
>
>
>
>
>
>
> > Hi.
>
> > I have a has_and_belongs_to_many relationship between two models. When
> > I use active scaffold to create one of the two models, I use form_ui
> > = : select , which gives me a series of checkboxes that in turn,
> > populate the join table.
>
> > My question is: can I filter those checkboxes to a smaller set using
> > some additional criteria (e.g sql query)? I read about
> >http://rdoc.info/github/activescaffold/active_scaffold/master/ActiveS...
> > d/Helpers/AssociationHelpers, but when I use
> > "options_for_association_conditions", it complains that my sql query
> > returns more than one row (which makes sense, because its exactly what I
> > need). It seems its made only for single associations, to filter a combo
> > box set of results.
>
> > I tried something like:http://www.pastie.org/1866627
>
> Please, send the log with sql query and error
>
>
>
> > I used conditions_for_collection too, in a similar way.
>
> > Any help will be greatly appreciated, thanks in advance.
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.