Comments (2)
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:
- catch this particular source of
ActionView::Template::Error
, check for the presence ofmodels/_model.html.erb
. If the file exists, change the error message to mention theconfig.action_view.prefix_partial_path_with_controller_namespace
configuration) - add
models/
as a lookup context prefix (in addition toscoped/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.
- add
models/
as a lookup context prefix (in addition toscoped/models/
), then attempt to gracefully fall back to the unscoped model partial.
I've opened #50852 to explore this option.
from rails.
Related Issues (20)
- Rails error reporter doesn't report exceptions in production HOT 5
- Sidekiq ActiveJob adapter resets provider_job_id on with retry_job HOT 3
- Passing an array to the `model` parameter of `form_with` does not work with singular, unpersisted resources HOT 1
- Read the Ruby Version in Gemfile Instead of Hardcoding the Version HOT 2
- `render "fizz"` and `render partial: "fizz"` behave differently when given a block HOT 2
- Pure ruby view templates, pages and components HOT 1
- `FileNotFoundError` in `AnalyzeJob` HOT 1
- nested_attributes_for :limit does not account for records marked for deletion
- no implicit conversion of String into Integer (TypeError) @env[name] HOT 2
- Relation `#distinct` doesn't raise an error for invalid arguments HOT 2
- ActiveModel::Dirty is broken in after_commit
- Blocked hosts: site.com To allow requests to these hosts, make sure they are valid hostnames (containing only numbers, letters, dashes and dots), then add the following to your environment configuration: config.hosts << "site.com" For more details view: the Host Authorization guide HOT 2
- GlobalID::Locator.locate_signed cannot find SGIDs created in a Rails 6.1 app HOT 6
- New find_or_create_by behavior in Rails 7.1 can introduce subtransactions in PostgreSQL HOT 5
- Invalid route POST request results in key space error 500 instead of 404 HOT 2
- has_many through alias_method HOT 4
- create_table `force` option drops table when `if_not_exists` option is present
- Add a `--db-prepare` option to run check and run migrations when booting the server
- `DuplicableTest#test_duplicable` failure with ruby 3.4.0dev HOT 2
- Path traversal in AcitveStorage, and lead RCE (Need secret_key_base) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.