Tom,
Even though your “composite” view displays different models you can
split it into different controllers. Let’s use a basic example of a
team has_many players. For this example, I would have two controllers,
TeamsController and PlayersController. This would allow for individual
updates of each of the models. Even though my “show” method for a team
has a list of players as well. In my show template, I can all players
in that team by doing something like this:
Team Detail View
<%= @team.name %>
<%= render :partial => “players/player”, :collection => @team.players
%>
In this example I am listing all players of a team with a partial in a
different directory. This naming convention is nice way to go because
in rails 2.0 you will be able to do this:
<%= render :partial => @team.players %>
Finally, if you have the situation that you create a player when you
create a team you could do something like this in your
TeamsController:
def create
@team = Team.new(params[:team])
@player = @team.players.build(params[:player])
if @team.save
redirect team_url(@team) # or simpley redirect @team in rails 2.0
else
render :action => ‘new’
end
end
if you were simply adding a player to an existing team do this in your
PlayersController:
def create
@team = Team.find(params[:team_id])
@player = @team.players.build(params[:player])
if @player.save
redirect team_url(@team) # or simpley redirect @team in rails 2.0
else
render :action => ‘new’
end
end
If you want a complete example check out Beast (forum written rails)
to show you how to divide an application up.
http://svn.techno-weenie.net/projects/beast/trunk/
You may consider doing a little reading on RESTful design. Although
you may not want to make it a restful application, it’s a great design
technique. Basically, there is a one to one mapping of controller to
model and you controller is restricted to the following methods:
index, show, new, create, edit, update, and destroy. There’s always
exceptions of course, but its a great pattern to following.
Helpful? Confusing? 
Cheers,
Nicholas
On Nov 27, 4:56 pm, Tom N. [email protected]