-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Columns with headers #84
Comments
Maybe, you could do with class User < ActiveRecord::Base
belongs_to :group
comma do
Group.all.each do |group|
__static_column__ group.name do |user| user.associated?(group) ? 'X' : '' end
end
end
end I am not sure if this works... It is not possible to add columns dynamically, so you have to restart your application when another group is added. |
This worked like a charm. Thanks!! Also, it seems that i don't need to restart the application when the group changes, at least not locally. Is there a way we can add this into the documentation, it would probably be helpful to others. |
Yeah, comma block is evaluated whenever You can fork this project, edit |
Is there a way to make a block build columns with custom headers. For example i have users that have associated groups. I'd like to be able to cycle through each group and make that a column header and put an X in the column if the user has that group. New groups can be added so making a ton of custom methods seems very inefficient if i can just make one that can handle all of them.
-Thanks
The text was updated successfully, but these errors were encountered: