<h4>&nbsp;</h4>
<%
	# This assumes that the association is included as a column in the active_scaffold_config.columns collection
	associated_columns = []
	associated_columns = params[:associations].split(" ") unless params[:associations].nil?
	unless associated_columns.empty?
		parent_id = params[:id]
		associated_columns.each do | column_name |
			association = active_scaffold_config.columns[column_name].association
			controller, controller_path = active_scaffold_controller_for(association.klass, params[:controller])
			table_name = association.table_name
			table_name = association.options[:join_table] if association.macro == :has_and_belongs_to_many
			primary_key = table_name + "." + association.primary_key_name
%>
		<%= render :active_scaffold => controller_path, :constraints => { primary_key.to_sym => parent_id}, :label => active_scaffold_config_for(association.klass).label + _("FOR") + active_scaffold_config.label, :options => {:association => column_name, :association_macro => association.macro, :parent_model => association.active_record} %>
<%
		end
  end
%>

<h4>&nbsp;</h4>
<%
	# This assumes that the association is included as a column in the active_scaffold_config.columns collection
	associated_columns = []
	associated_columns = params[:associations].split(" ") unless params[:associations].nil?
	unless associated_columns.empty?
		parent_id = params[:id]
		associated_columns.each do | column_name |
			association = active_scaffold_config.columns[column_name].association
			controller, controller_path = active_scaffold_controller_for(association.klass, params[:controller])
			table_name = association.table_name
			table_name = association.options[:join_table] if association.macro == :has_and_belongs_to_many
			table_name = association.through_reflection.table_name if association.options[:through]
			primary_key = table_name + "." + association.primary_key_name
%>
		<%= render :active_scaffold => controller_path, :constraints => { primary_key.to_sym => parent_id}, :label => active_scaffold_config_for(association.klass).label + _("FOR") + active_scaffold_config.label, :options => {:association => column_name, :association_macro => association.macro, :parent_model => association.active_record} %>
<%
		end
  end
%>

Support :has_many :through nested scaffolds.
Support :has_many :through nested scaffolds.

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@168 561dde7e-7729-0410-be8e-ef83869d6c7d
