ok now I solved the problem with create but nested scaffolds still
doesnt'work the code is pretty much the same i changed somenthing on
the controller now they look like this
controller :
class AuthorsController < ApplicationController
active_scaffold :author do | config |
config.columns = [:name,:country,:date_of_birth]
config.nested.add_link("Author's books", [:books])
end
end
class BooksController < ApplicationController
active_scaffold :book do | config |
config.columns = [:title, :genre, :year_of_publication]
end
end
Model :
class Authors < ActiveRecord::Base
has_many :books
end
Class Books < ActiveRecord::Base
belongs_to :author
end
the problem now is that when I click on the link "Author's books" (the
nested scaffold) i receive the error
Request Failed (code 500, Internal Error)Close. I've read that this
problem is related with something wrong in the controller
so I've firebugged the request and that's the erro I discovered :
NoMethodError in Companies#nested
Showing vendor/plugins/active_scaffold/frontends/default/views/
_nested.html.erb where line #13 raised:
undefined method `association' for nil:NilClass
Extracted source (around line #13):
10: associated_columns.each do | column_name |
11: # find the column and the association
12: column = active_scaffold_config.columns[column_name]
13: association = column.association
14:
15: # determine what constraints we need
16: @constraints = { association.reverse => parent_id }
I don't really know how to figure it out... any ideas?
--
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.