Hi,
I'm trying to clean up my code and get rid of a lot of ugly hashes. In my views I define several actions like this:
@actions = {
:interest => {'Show interest', link_to(..), :disabled => true},
:follow => {'Follow this case', link_to(..)}
...
}
As these hashes grow, the maintainability decreases. I want to convert the above format to something like:
actions do
item :interest, 'Show interest', link_to(..), :disabled => true
item :follow, 'Follow', link_to(..)
...
end
How do I structure my helper methods to allow this? Preferably the 'item'-method should only be available in the 'actions' block and not in the global scope.
Thanks!