761 questions
0 votes
0 answers
84 views
Browser doesn't apply the CSP received from HTTP headers?
here is my aim : implement a Content Security Policy backend side and apply it frontend side through the browser. here is the issue : none of the rules set up are effective frontend side. What I tried ...
0 votes
0 answers
53 views
vue frontend with rails-api backend application not loading environment variables with nginx as a proxy in production mode
I have a .env.production file in which I have VITE_BACKEND_URL=http://www.example.net/api. This is the structure of my application /MY_APP /app /frontend /src /public vite.config.js ...
0 votes
0 answers
155 views
401 when authenticating swift client with rails API (using Devise)
I have a Rails API using Devise JWT for authentication. When trying to login using Postman it works like a charm: But when I call from my Swift app, I have a 401 Unauthorized with invalid credentials....
0 votes
0 answers
45 views
How to conditionally render the relationships in rails. I am using jsonapi-rb for serialization
I have tried using procs for conditionally rendering the relationships but it does not work. What can I do to render the relationships conditionally class ProductSerializer include JSONAPI::...
0 votes
1 answer
531 views
How to handle PORT error on render for rails api-only application - NO OPEN PORTS DETECTED during deployment
I am trying to deploy my rails api-only app on render. When I effect changes and push to github, it builds successfully, but does not deploy. The error is "./bin/rails: Permission denied" &...
0 votes
1 answer
103 views
Vue frontend not being rendered in an application with Rails serving as an api and vite as frontend server
I am developping an application with Ruby on Rails for the backend and Vuejs for the frontend. Rails is being consumed as an api. Vite is the frontend server. When I launch my application, rails s (in ...
0 votes
1 answer
35 views
Rails create/destroy association for existing models by JSON call
I have two models that I want to manually associate or dissociate on demand. class Car < ApplicationRecord has_many :wheels, dependent: :nullify end class Wheel < ApplicationRecord ...
0 votes
2 answers
117 views
Chain Rails .where to choose if ANY true
I have an issue with a conditional query I've written in a Rails application. Currently I have Stores being queried if certain locations (location_north, location_south, etc) are true and if certain ...
0 votes
0 answers
79 views
What is the least computational method of uploading files from native mobile to a Rails API using middleware to convert the file to a rails object?
Some context: I am trying to construct a postman request that I will hand off to a mobile developer. The mobile developer will use it as a template for implementing some functionality that involves ...
1 vote
1 answer
120 views
Chaining .where method in Rails API
I have a web app built with a Rails API to collect submissions. I have a form being submitted that sends an email lead to certain Stores that have matching attributes (location, size, etc). They are ...
0 votes
0 answers
58 views
rails api with active storage returns a link for an uploaded to s3 service file to a non existing page
My rails API uses active storage to upload a given user avatar image to s3 service storage.yml amazon: service: S3 access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %&...
-1 votes
1 answer
423 views
ActionController::API vs ActionController::Base
I want to know what all functionalities are restricted in API and will there be any difference in speed if we use Base in place of API. I searched many places to find the difference between those two ...
0 votes
1 answer
3k views
In Nextjs/App Router, How to pass httponly cookies in fetch request to API using server actions
I have a Nextjs 13 frontend using the App Router setup and a Rails 7 API-only backend using Doorkeeper for authentication. I have a new product form that makes use of a Nextjs "server action"...
0 votes
1 answer
597 views
How to persist session in rails API only app
I am pretty new to ruby on rails, I want to add sessions back to rails 6 API app such that I get the current_cart id in session, if the the id does not exist in session, it goes on to create a new ...
-1 votes
2 answers
192 views
Communication between react and api
Everything ok? I created a react application that communicates with a rails api. It is a very simple application, but there is this communication between react and api. My question is… Do I need to ...