Added a forget rule for dispatching views.

for example: /users/johndoe should have looked in order to
    1 - JohndoeUserHTMLView
    2 - UserHTMLView
    3 - HTMLView
    the 2 wasn't done before.
This commit is contained in:
Yann Esposito (Yogsototh) 2010-03-31 22:21:45 +02:00
parent 1382924252
commit 8d814cdb8f

View file

@ -43,6 +43,16 @@ module Rubyzome
puts %{selected view = #{view_name}} puts %{selected view = #{view_name}}
return return
end end
# check Ressource Type Specific View
# eg: /stats.xml will render using
# app/views/xml/StatXMLView
view_name=%{/#{type.downcase}/#{model}#{type.upcase}View}
puts %{try view = #{view_name}}
if $views.has_key?(view_name)
@view=$views[view_name].new
puts %{selected view = #{view_name}}
return
end
else else
# check Plural Ressource Specific View # check Plural Ressource Specific View
# eg: /stats.xml will render using # eg: /stats.xml will render using