#39 ✓resolved
dstamat (at elctech)

Rails 2.2rc1 - ActionView::TemplateFinder

Reported by dstamat (at elctech) | October 28th, 2008 @ 12:32 PM

TemplateFinder has been phased out in Rails, and some new conventions are in place. See similar issue here: http://groups.google.com/group/c...

Loading our application up dies in plugin.rb, on the reference to ActionView::TemplateFinder.process_view_paths(view_path), as ActionView::TemplateFinder no longer exists.

Comments and changes to this ticket

  • Priit Tamboom

    Priit Tamboom October 29th, 2008 @ 12:08 PM

    I also got the same issue, I digged a bit and found that:

    lib/engines/plugin.rb line 88 def add_plugin_view_paths view_path = File.join(directory, 'app', 'views') if File.exist?(view_path)

    ActionController::Base.view_paths.insert(1, view_path) # push it just underneath the app

    end end

    Perhaps we can use ActionController::Base.append_view_path(view_path) instead of ActionController::Base.view_paths.insert(1, view_path).

    Anyhow, I got /home/aa/apps/adva/vendor/rails/actionpack/lib/action_view/paths.rb:102:in initialize': wrong number of arguments (2 for 3) (ArgumentError)

    when calling ActionController::Base.append_view_path(view_path)

    Any tips what method is use instead TemplateFinder.process_view_paths ?

    Cheers, Priit

  • Priit Tamboom

    Priit Tamboom October 29th, 2008 @ 11:50 PM

    Sorry about messed up formating in the last post.

    In the morning I figured out, that my wrong number of arguments comes from safemode plugin what overides ActionView::Template initialization.

    Anyhow, ActionView::Base.append_view_path should be more clean way of adding new view paths.


  • James Adam

    James Adam October 30th, 2008 @ 04:23 AM

    • State changed from “new” to “open”
    • Tag changed from 2.2rc1, actionview::templatefinder to 2.2rc1, actionview::templatefinder, template, view
    • Assigned user set to “James Adam”

    The issue with append_view_paths is that it adds the path to the env of the VIEW_PATH, whereas we actually want to push each plugin's view paths to the top of the stack, but just below the application views (so pushing them into position 1, rather than position 0).

    So, I'm not sure if it's possible to use append_view_path without radically changing either the precidence order of plugins, or the way that plugins are loaded.

    Does that make sense? Any ideas?

  • Priit Tamboom

    Priit Tamboom October 30th, 2008 @ 05:33 AM

    Thanks for reply, now i got it.

  • Tekin

    Tekin October 30th, 2008 @ 06:55 AM

    Isn't this simply a case of changing:




    I've got a coupe of apps running successfully on 2.2 with the above change.

    There's also another change required in action_mailer.rb:




  • James Adam

    James Adam November 9th, 2008 @ 06:14 AM

    • State changed from “open” to “resolved”

    This was fixed in the 'edge' branch a while back - apologies for not updating this ticket (http://github.com/lazyatom/engin...)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The rails engines plugin itself

Shared Ticket Bins