So I have two nested partials with calls to insert_html. Basically each team has multiple players and I have an add player button and an add team button which each call a partial with the following helpers
module TeamsHelper
def add_team_link(name)
link_to_function name do |page|
page.insert_html :bottom, :teams, :partial => 'team', :object => Team.new
end
end
def add_player_link(name2)
link_to_function name2 do |page2|
page2.insert_html :bottom, :players, :partial => 'player', :object => Player.new
end
end
end
This works just fine if I only use one insert_html call but when I try to have both I get a javascript error "missing ) after argument list" and the outer "add team" button fails. Any ideas?