Questions tagged [actiondispatch]

The ActionDispatch namespace module within the Ruby on Rails web framework.

84 questions
42
votes
5 answers

Rails 5.1: "unknown firstpos: NilClass" - Issue reloading application

Following an upgrade from Rails 5.0 to 5.1 I'm getting this error anytime the app reloads, either from code changes during rails server or if I call reload! from the console. 13:53$ rc Loading development environment (Rails 5.1.1) 2.3.1 :001 >…
JP Duffy
  • 1,307
  • 1
  • 11
  • 18
20
votes
5 answers

Test for HTTP status code in some RSpec rails request exampes, but for raised exception in others

In a Rails 4.2.0 application tested with rspec-rails, I provide a JSON web API with a REST-like resource with a mandatory attribute mand_attr. I'd like to test that this API answers with HTTP code 400 (BAD REQUEST) when that attribute is missing…
das-g
  • 9,718
  • 4
  • 38
  • 80
17
votes
2 answers

ActionDispatch::Routing::RouteSet#call Rails 4.1 really slow

I've searched for days but can't find any relevant answers to this question. In my Rails 4.1 app hosted on Heroku, when the load goes up, some PUT requests get REALLY slow. The slowest one today was 53 seconds. All without the database (MongoDB)…
16
votes
5 answers

Custom Error Handling with Rails 4.0

I'm building a Ruby on Rails api using Ruby 2.0 and Rails 4.0. My app is almost solely a JSON API, so if an error occurs (500, 404), I want to capture that error and return a nicely formatted JSON error message. I've tried this and also: rescue_from…
Ethan Mick
  • 9,517
  • 14
  • 58
  • 74
16
votes
3 answers

What is ActionDispatch?

I have a fairly decent grasp on the basic Rails concepts like ActiveRecord, routing, migrations, etc. One thing I'm having a hard time understanding is ActionDispatch. I can't find a plain-English description (or really any description) of what it…
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
13
votes
2 answers

Rails 4.2 server; private and public ip not working

I recently updated my rails 4.1.8 to 4.2 I'm not able to access rails app using private ip 192.168.1.x:3000 and also with my public-ip address. Rails app is working with lvh.me:3000, 0.0.0.0:3000, localhost:3000 and 127.0.0.1:3000. But it looks all…
Ashwin Yaprala
  • 2,737
  • 2
  • 24
  • 56
11
votes
3 answers

Get constraint based url using url_for based on mounted engine

Is there any way that i can make url_for to return the url based on the request.host during action dispatch routing ? mount Collaborate::Engine => '/apps/collaborate', :constraints => {:host => 'example.com' } mount Collaborate::Engine =>…
Vivek Sampara
  • 447
  • 4
  • 20
10
votes
4 answers

Rails: Filter sensitive data in JSON parameter from logs

I am running Rails 3 and trying to filter sensitive information out of our logs which are JSON blobs that are passed as post parameters. For example, user creation might take a post param called user with a string value that is a JSON object. One of…
thefugal
  • 1,214
  • 1
  • 10
  • 18
9
votes
3 answers

Overriding params in nested routes

I want to have consistency in naming convention of my routes. Default param is :id for any resource. However if one nests another resource in it, param of parent resource changes to :parent_id. My routing looks like: resources :users do resources…
sonalkr132
  • 967
  • 1
  • 9
  • 25
9
votes
2 answers

How to filter nested parameters from Rails logs

I see that I can filter keys from Rails logs here, but it's not entirely clear how I can filter a key that is nested inside the parameter hash. My params hash looks like this: {"download"=>{"attachment_id"=>"54039",…
mehulkar
  • 4,895
  • 5
  • 35
  • 55
7
votes
2 answers

Rails, how do you access the raw request data at the absolute lowest level?

When is the Rails request object available at the earliest time during the request lifecycle? Essentially, when is the request first available as a request object, and in which object? ActionDispatch? Can you access request parameters from…
scottkf
  • 185
  • 3
  • 9
5
votes
2 answers

Rails 6.1.1 doesn't load the webpacker created CSS files in production mode

this is my first time asking a question here, I hope I would explain my problem well. In one of my recent tasks, I'm upgrading our app to Ruby and Rails (Ruby 2.6.6 > 2.7.2, Rails 6.0.3.2. > 6.1.1) I had several issues along the way, upgraded some…
Pozithron
  • 53
  • 1
  • 5
5
votes
2 answers

ActionDispatch::Cookies not setting Set-Cookie header in response but response.set_cookie does

I have a Rails 5 API only app and want to send cookies in the response of a JSON request. When I use ActionDispatch::Cookies to set a cookie in the response of the request it doesn't set Set-Cookie header in the response. Although…
Raounak Sharma
  • 345
  • 1
  • 4
  • 15
5
votes
2 answers

Configuring Rails App to handle multiple subdomains and multiple cookies

I have a rails app which supports multiple domains and each domain may have multiple subdomains. Users visiting mydomain1.com do not receive the same experience as mydomain2.com (although the base behaviour of the apps is the same) Therefore, if a…
5
votes
1 answer

Rails: ParameterFilter::compiled_filter tries to dup symbol

I'm running rails3 with rails exception-notifier gem. When an exception occurs, and an email should be sent, I'm getting an exception from the ParameterFilter class. I've found the problem in the rails source, and am not sure the best way to…
1
2 3 4 5 6