Hello again
I have a list view for Player and need to show only related items for
a double association
Players have a team_id
Teams have a manager_id
Managers have a user_id
I'm trying to call a list of players for the current logged in user.
Fiddling around with constraints, conditions, joins and more but its
not quite working,
What can I do?
in index_myplayers.html.erb
<%= render :active_scaffold => 'players', :label => 'My Players
(s)', :joins => ' LEFT JOIN managers ON managers.id =
teams.manager_id ', :conditions =>{'managers.id'=>'teams.manager_id'}
%>
this doesnt find the join
I call the method from the players controller (index_myplayers), where
I also have a standard index method (shows all players), so
conditions_for_collection gets would apply to both sets, not what I
need.
I could add a column to the players model (user_id) this could be
quicker, but again, I'm sure AS can do this
def active_scaffold_joins
'LEFT JOIN managers ON managers.id = teams.manager_id '
end
also would apply to both index methods, but throws an error cant
convert Array to String
apogolies keep you all busy with my learning curve!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---