Hi,
I have a application where I define Templates which are nothing but a full
MVC structures.
For e.g. I have a template called Multiple_Choice_Questions which actually
corresponds to MultipleChoiceQuestionsController and so on. These values
are defined in the DB and there are many templates that are defined.
I am able to instantiate this class model for e.g. using the following
snippet
Object::const_get(@section.template.template_class.camelize.singularize)
and I can also put the following in the view to go directly to the
controller
<%= link_to content_tag(:span, "New Question") ,{ :controller =>
@section.template.template_class.downcase ,:action=>:new, :section=>@
section.id } %>
and both of these work perfectly fine.
Now here is my question. In order to segregate these different templates, I
plan to move them into individual folder, i.e. for e.g.
MathTemplate:: MultipleChoiceQuestions Controller which would be a
controller under the MathTemplate folder.
I can achieve the instantiation using
Object::const_get(MathTemplate).const_get(@section.template.template_class.camelize.singularize)
but I am struggling with the following
<%= link_to content_tag(:span, "New Question") ,{ :controller =>
@section.template.template_class.downcase ,:action=>:new, :section=>@
section.id } %>
What should I put so that the controller is properly recognized.
Thanks for your help in advance.
Ankur
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.