Here you go.....nothing unusual here
class Application < ActiveRecord::Base
has_many :output_data_flows,
:foreign_key => "output_application_id",
:class_name => "DataFlow",
:dependent => :destroy
has_many :input_data_flows,
:foreign_key => "input_application_id",
:class_name => "DataFlow",
:dependent => :destroy
end
class DataFlow < ActiveRecord::Base
belongs_to :input_application, :class_name =>
"Application", :foreign_key => "input_application_id"
belongs_to :output_application, :class_name =>
"Application", :foreign_key => "output_application_id"
end
class ApplicationsController < ApplicationController
active_scaffold :Application do | config |
config.create.columns = [:description]
config.update.columns = [:description]
config.list.columns = [:description]
config.nested.add_link("Links", [:input_data_flows])
config.columns[:input_data_flows].association.reverse
= :input_application
end
end
class DataFlowsController < ApplicationController
active_scaffold :DataFlow do | config |
config.columns[:input_application].association.reverse
= :input_data_flows
end
end
What is interesting is I put some diagnostics in
active_scaffold_controller_for in active_scaffold.rb and I get this
output:
>>>>> 1.controller for class - klass = Application
>>>>> 2.namespace = ::
>>>>> 3.candidate controller name = applications
>>>>> 4.controller model= Application
>>>>>> Sucesss!
>>>> 4.controller model= DataFlow
>>>>> 1.controller for class - klass = DataFlow
>>>>> 2.namespace = ::
>>>>> 3.candidate controller name = data_flows
>>>>> 4.controller model = DataFlowmethod=get]
for the last line I'm emmiting to match the unless clause
print "\n>>>> 4.controller model= #
{controller.active_scaffold_config.model}"
so it looks like the active scaffold config.model is getting
corrupted!
Thanks !
On Dec 4, 12:32 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Jueves, 3 de Diciembre de 2009 21:44:53 simonS escribió:
>
> > Hi
>
> > Note: <*> is name of Model.
>
> > This has been bigging me for a while, first request it works,
> > subsequest requests I get this error.
>
> > Everything is as expected. I define the controller, and model
> > correctly the association has reverse association's defined. There is
> > noting in the log file, but this appears as the content of the nested
> > scaffold.
>
> > I define a active_scaffold_controller_for and I get the error twice.
>
> Please, post your controllers and models
>
> --
> 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.