I hope this is an easy question:

Let's say a :team has_many :players;
a player has statistics, like batting_average.
a team has overall statistics averaged over all its players, 
overall_batting_average.

I can make a special-purpose view of teams that shows ONLY team name and 
overall batting average.
I do this simply by making a new activescaffold controller, say 
team_stats_controller.rb, and loading config.columns with those two fields.

Now I want this special_purpose view of teams to allow drill-down to 
players. ("Who's responsible for the crummy batting average?")
I can do this simply by adding "players" to config.columns in 
team_stats_controller.  AS then makes the players column a link to a 
sub-form showing all players for that team.
So far, so good.

But I want the sub-form "players" page to have a DIFFERENT layout from the 
normal players page.
Perhaps I want it to only show the player's name and batting_average.

What's the best way to do this?

Set up an activescaffold controller, say player_stats_controller.rb  to show 
this special layout, then add a helper method for the players_column that 
puts a link to that controller? But that won't limit the view to just 
players for that team.

Is there a better way to customize the layout of a sub-form?


-- 
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