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

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -