Code Monkey home page Code Monkey logo

Comments (4)

seanpdoyle avatar seanpdoyle commented on September 27, 2024

After doing more searching, this is intended behavior when config.action_view.prefix_partial_path_with_controller_namespace = true (true by default).

This change was introduced in March of 2012 as part of #5625.

I'm considering two resolutions:

  1. catch this particular source of ActionView::Template::Error, check for the presence of models/_model.html.erb. If the file exists, change the error message to mention the config.action_view.prefix_partial_path_with_controller_namespace configuration)
  2. add models/ as a lookup context prefix (in addition to scoped/models/), then attempt to gracefully fall back to the unscoped model partial.

As a consumer of Action View, my intuition is that the lookup would fallback, in the same way that a controller that inherits from ApplicationController could define its own view, then rely on fallback to render an app/views/application partial.

@rafaelfranca do either of those options seem viable?

from rails.

seanpdoyle avatar seanpdoyle commented on September 27, 2024
  1. add models/ as a lookup context prefix (in addition to scoped/models/), then attempt to gracefully fall back to the unscoped model partial.

I've opened #50852 to explore this option.

from rails.

rails-bot avatar rails-bot commented on September 27, 2024

This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 7-1-stable branch or on main, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.

from rails.

seanpdoyle avatar seanpdoyle commented on September 27, 2024

I've opened #50852 to resolve this issue, and someone from Core has expressed interest in the PR.

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.