Note the excludes in task controller were my attempt to fix the
problem by removing a polymorphic relation that wasnt needed in as.
thanks
Joel

class Task < ActiveRecord::Base
  has_many :notes, :as => :notable
  has_many :emails
  has_many :documents
  belongs_to :application_step
  belongs_to :taskable, :polymorphic => true
end

class ApplicationStep < ActiveRecord::Base
  belongs_to :enrollment_application
  has_many :tasks
end

class AdminApplicationStepsController < ApplicationController
   before_filter :authenticate

    active_scaffold :application_step do | config |
      config.columns[:description].css_class = 'markdownlist'
      config.list.columns =
[:complete,:title,:description,:tasks,:updated_at]
      config.columns[:complete].form_ui = :checkbox
      config.columns[:title].weight = -100
      config.columns[:description].weight = -50
    end
end

class AdminTasksController < ApplicationController
   active_scaffold :task do | config |
      config.columns[:description].css_class = 'markdownlist'
      config.list.columns =
[:name,:description,:emails,:notes,:documents,:updated_at, :approved,  
:action_type]
      config.columns[:complete].form_ui = :checkbox
      config.create.multipart = true
      config.update.multipart = true
      config.create.link.page = true
      config.update.link.page = true
      config.columns[:emails].form_ui = :select
      config.columns[:name].weight = -100
      config.columns[:description].weight = -50
      config.columns.exclude :taskable, :taskable_id, :taskable_type
    end
end




On Mar 18, 11:40 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> > On Mar 18, 5:10 am, "Sergio Cambra .:: entreCables S.L. ::."
>
> > <[email protected]> wrote:
> > > On Miércoles, 17 de Marzo de 2010 22:51:40 joelkeepup escribió:
> > > > Hi, im getting this error:
>
> > > > ActiveScaffold::MalformedConstraint in Admin
> > > > registrarsController#table
> > > > Malformed constraint `Registrar#application_step'. If it's a
> > > > legitimate column, and you are using a nested scaffold, please specify
> > > > or double-check the reverse association name.
>
> > > > when I drill down, here is my object model
> > > > Applications -> ApplicationSteps -> tasks -> Error happens when trying
> > > > to show tasks
>
> > > > Applications belong_to Registrars.
>
> > > > This all worked until I moved my controllers to have prefix of "Admin"
>
> > > > I have no idea why when showing the tasks its getting this error.
>
> > > > Registrars have no relation to application_step except through
> > > > applications
>
> What are association definitions between ApplicationSteps and Tasks? Are the
> links generated by AS or have you added them with config.action_links.add or
> config.nested.add_link?
>
>
>
> > > > Im sure I have a typo somewhere, but dont know how to debug this, any
> > > > suggestions?
>
> > > Post your Applications and Registrars models.
> > > Do you have a has_one or has_many association in Registrars model?
>
> > > --
> > > Sergio Cambra .:: entreCables S.L. ::.
> > > Mariana Pineda 23, 50.018 Zaragoza
> > > T) 902 021 404 F) 976 52 98 07 E) [email protected]
>
> --
> 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.

Reply via email to