# Calling a helper based on dynamically created string

**URL:** <https://www.ruby-forum.com/t/calling-a-helper-based-on-dynamically-created-string/87384>\
**Category:** Rails\
**Created:** [March 2, 2007, 4:51am UTC](https://www.ruby-forum.com/t/calling-a-helper-based-on-dynamically-created-string/87384 "2007-03-02T04:51:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Zornek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@Mike\_Zornek](https://www.ruby-forum.com/u/Mike_Zornek)\
**Post date:** [March 2, 2007, 4:51am UTC](https://www.ruby-forum.com/t/calling-a-helper-based-on-dynamically-created-string/87384/1 "2007-03-02T04:51:29Z")

</div>

You know how when you are using the new resource features in Rails 1.2  
it  
will create all these helper methods for you. Like if I had a resource  
for  
my `Comment` class I’d get `comments_url`, `comments_path`,  
`comment_path(1)`, etc. Well let’s say I’m trying to dry up my views –  
some  
of these crud pages are just very repetitive – how do I call a helper  
based  
on a string I create. I’d like to create a string like  
`object.class.to\_s.downcase.pluralize + ‘\_url’ and then call that  
helper.  
How can I do this?

## ~ Mike

Work: [http://ClickableBliss.com](http://ClickableBliss.com)  
Play: [http://MikeZornek.com](http://MikeZornek.com)
