Comments (5)
The naming conflict was the root problem, but not the one described above. A class attribute's name was the same of a class goverend by a has_many relationship (initially this had not been specified in the model). Once specified, the record was no longer creatable and the processing reverted to HTML.
from rails.
Are you sure that your controller action has a format.turbo_stream
response?
If it is not found, it will try to respond with format.html
instead.
P.S. data: { remote: true }
has no effect in rails 7
from rails.
Definitive.
I run the controller •without• mentioning format, in order to default processing the rails way ...
If there is no view with the turbo_stream format, the 'html' file is then rendered.
In both cases, however, the logging will be
Processing by PartisController#create as TURBO_STREAM
.
Something in this controller is forcing the processing to got to HTML...
from rails.
I belive rails determines the content type based on the Accept
header. If it includes text/vnd.turbo-stream.html
the request will be handled as a TURBO_STREAM
.
You can check the request header using the browser or with logger.debug request.headers["Accept"]
in the controller action.
from rails.
well the content type is being established as HTML
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
and not the default TURBO_STREAM.
I've tried many variants, trying unsucessfully to override... Now <%= form_with( url: create_consumers_partis_path, data: {turbo: true}) do |form| %>
which renders in HTML <form data-turbo="true" ...
but it still processes to HTML...
So something is diverting the normal process.
update I worked on the assumption of some naming conflict: there are multiple classes who are compounds (Parti, ConsumerParti, GroupParti), as well as compounded named actions ('create_consumers') which might be generating routing confusion, and thereby diverting the intended processing method. Having eliminated potential conflicts derived from action names, the behaviour remains stuck to HTML processing for any action that regards the Parti, ConsumerParti, GroupParti
classes
from rails.
Related Issues (20)
- `remove_check_constraint` cannot be safely rolled back automatically from 7.1 HOT 3
- Associations with through don't work until saved
- It's not possible to override attribute-based `key_provider` or `key` using `ActiveRecord::Encryption.with_encryption_context` HOT 1
- params.deep_transform_keys! doesn't work with camelCased json payloads (ActionController) HOT 1
- Running `bin/setup` in an application template errors out when `bin/dev` uses Foreman HOT 2
- Change controller generators to use _path instead of _url for redirects HOT 6
- Rails multi Tenant with Multi DB not working - No connection pool for 'Activerecord::Base' found. HOT 1
- Fix dev container smoke test HOT 1
- Schema dumps incorrectly for secondary databases HOT 6
- ActiveRecord won't convert to interval from string HOT 2
- Composite keys given as array of strings break nested_attributes update HOT 2
- Assigning attributes for nested association raises if association_id is not specified first
- `token_for` does not work with composite primary keys
- Unnecessary double signature in authentication generator
- ActiveRecord - `update!` and `save!` do not trigger validations neither raise exceptions with emtpy attributes. HOT 5
- non-rails project now throws "uninitialized constant #<Class:ActiveSupport::Delegation>::Inflector" HOT 1
- Issue with new rails app -> .env.erb file HOT 5
- alias_attribute broken in Rails 7.1.4 HOT 7
- Rate limiting does not work for API app , `cache_store` method is missing for ActionController::API HOT 1
- Second-db schema is overwritten erroneously when running db:migrate HOT 3
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.