# How call model for the name

**URL:** <https://www.ruby-forum.com/t/how-call-model-for-the-name/90311>\
**Category:** Rails\
**Created:** [March 27, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/how-call-model-for-the-name/90311 "2007-03-27T18:32:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [March 27, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/how-call-model-for-the-name/90311/1 "2007-03-27T18:32:24Z")

</div>

How call model for the name, for example:

def my\_action(model)  
model.find :all  
end

\<%= my\_action :Client %\>

ps.: That has to be in String, however I call for a URL

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [March 27, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/how-call-model-for-the-name/90311/2 "2007-03-27T18:43:15Z")

</div>

Marcelo J. wrote:

> How call model for the name, for example:
> 
> def my\_action(model)  
> model.find :all  
> end
> 
> \<%= my\_action :Client %\>
> 
> ps.: That has to be in String, however I call for a URL

def my\_action(model)  
model.to\_s.constantize.find :all  
end
