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
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
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs