Forum: Ruby on Rails Local Collection Variables in Helpers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sebastian F. (Guest)
on 2006-03-03 01:30
(Received via mailing list)
Is there any way i can reference a local variable of a partials
collection in the helper?

For instance, for each iteration of a list represented in a partials
collection i want to display a default value if no value is set.  i
would rather not litter the view with conditionals. When i write a
helper method referring to the local collection variable (eg.
collection_name.title) it gives me an error:  undefined local
variable or method

is this possible?

thanks,
Sebastian
This topic is locked and can not be replied to.