activescaffold/active_scaffold — Issue #148: Colspan set wrong on nested edit
Author: clyfe
Created: 2012-03-09 23:34:49+00:00
State: open

* Steps to reproduce
User has many Roles.
Open roles under a user in nested mode.
Click edit role.

* What should be the correct result
The edit form should span over the same number of columns as in the current list, via inline adapter's colspan.

* What is the erroneous result
Instead of having the current list's colspan it uses the parent's

The error was introduces in this commit:
https://github.com/activescaffold/active_scaffold/commit/fd5d0e816b6052ea7883fc8cb0a51996a9d72c0d

I propose the following:

```ruby
column_count = if nested? && params[:action] == 'index'
active_scaffold_config_for(nested.parent_model).list.columns.count + 1
else
active_scaffold_config.list.columns.count + 1
end
```

Not sure if there's any better solution...