1,627 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
108
views
Why is Rails generating separate cookies for subdomains?
I have a Rails 6.1 application that previously used to serve assets from /assets (asset_host was unset)
Recently I've changed the asset_host to use //assets<X>.example.com/ where X would be a ...
0
votes
0
answers
41
views
How to test rack middleware routing external domain to users subdomain
I am attempting to build an app where a user creates an organization gets a custom subdomain generated for them that they can access. This works. The next step is to allow them to add a custom domain ...
1
vote
0
answers
81
views
ruby cuba framework Cross Site Request Forgery(csrf)
Can someone explain me how to use in form and how to pass data to route with simple example...
<form>
{{ csrf.form_tag }}
</form>
1
vote
0
answers
89
views
How to use csrf in cuba framework ruby?
When I add plugin:
Cuba.plugin Cuba::Safe
In the post method I see that csrf.safe? returns false
class Cuba
module Safe
module CSRF
def token
session[:csrf_token] ||= SecureRandom....
0
votes
1
answer
76
views
How to see absolute paths in swagger for sinatra (rswag)
Setup
# Gemfile
gem 'rspec-swag'
# config.ru
map '/orders' do
run Web::OrdersApp
end
map '/admin/orders' do
run Web::AdminOrdersApp
end
# rspec
...
-2
votes
1
answer
80
views
How to pass raw binary data to the put() method of rack/test?
I'm doing this:
require 'rack/test'
data = # some binary data, for example, ZIP archive
put('/foo', data, 'content_type' => 'application/octet-stream')
Works just fine, until I put the % symbol ...
1
vote
0
answers
91
views
RackInitializationException: exit error when deploying JRuby (9.4.8.0) WAR in Tomcat 9 | Jruby-Rack 1.2.2
I am encountering an issue when deploying a JRuby (9.4.8.0) WAR file in Tomcat (9.0.58.0). During initialization, the deployment fails with a RackInitializationException and an exit call in the ...
0
votes
0
answers
71
views
facing issue after updating rails from 4.2.10 to 6.1.7.3
Below is my stacktrace, and I was facing this issue after rails upgrade.
and this issue was happening after deploying my code.
I updated the params structure aswell by using params.permit! but still ...
1
vote
1
answer
245
views
How to load gem's Railites only after all config/initializers load?
I have a gem which conditionally loads RailsWarden::Manager, based on a flag in the config/initializers/mygem.rb file:
module Mygem
class Railtie < Rails::Railtie
initializer "...
0
votes
1
answer
58
views
SQLite3 and Rack Basic Auth cannot use username as execution parameter
Consider the following code snippet:
require "sqlite3"
db = SQLite3::Database.new "my.db"
p db.execute("select * from user where name = ?", ["my_user_name"])
...
0
votes
1
answer
73
views
Sinatra doesn't parse Slack interactive content payload
I'm trying to use Slack interactive content to send the response of a button into a Sinatra app but the body doesn't get de-serialized.
Whenever I try to use the Slack message button I receive this ...
2
votes
1
answer
296
views
How can I retry an ActionController action inside a rescue_from for a StaleObjectError
I want to do something like this:
MyController < ApplicationController
rescue_from ActiveRecord::StaleObjectError, :retry
I have an app where users and admins are occasionally updating the same ...
1
vote
0
answers
103
views
undefined method `then' for #<Array:0x000XXXXX> when starting rails server
When I'm starting Rails Server to run my app, I get this error on the browser and terminal,
Yesterday It was working fine but suddenly getting this issue,
Puma caught this error: undefined method `...
2
votes
3
answers
803
views
Unicorn + Rails 7.1: TypeError: wrong argument type strio (expected strio) (TypeError)
User
I am running a large Rails app with the Unicorn webserver in production. After upgrading from rails 7.0 to 7.1 I am getting the following issues:
Here is the error that happens for every request ...
0
votes
1
answer
93
views
can we have rack middleware after main?
I am trying to understand how order in middleware of rack work. I have this middleware
class Middleware1
def initialize(app)
@app = app
end
def call(env)
puts "Middleware 1 start&...