Hi,
I have a question about template file path.
I want to change template path according to a certain condition.
I tried the following code and it works fine in Rails 2.1.
But I don’t know this is good or not.
Is there any good solution? Please give me an advice.
module ActionView #:nodoc:
class TemplateFinder #:nodoc:
alias pick_template_extension pick_template_extension #:nodoc:
def pick_template_extension(template_path) #:nodoc:
if a_certain_condition()
new_path = “keitai/#{template_path}”
template_path.replace(new_path)
end
pick_template_extension(template_path)
end
end
end
–
regards,
makoto kuwata