ruby on rails - Fill instance variable with all Users from table -


i want fill instance variable groups names.

how do this?

@groups = group.name.all 

obviously, doesn't work. don't know search for. table called groups, field name. doing different controller can see groups if use

@groups = group.first.name 

so associations seem work.

@groups = group.all.map(&:name) 

Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -