I need a good way to create a Rails 3 path set from an array in an assistant link_to.
I have:
TITLES = ['foo', 'bar', 'baz']
TITLES.each do |t|
= link_to t, (.....path....)
Thus, I need to build a set of paths:
foo_super_users_path(user)
bar_super_users_path(user)
baz_super_users_path(user)
As you can see, I need to add the same _super_users prefix for each individual path and pass the custom object. As a final result, I need something like:
link_to t, foo_super_users_path(user)
link_to t, bar_super_users_path(user)
link_to t, baz_super_users_path(user)
Your suggestions are really appreciated.
source
share