Rails 'button_to' is not working with 'send_file' method - ruby-on-rails

In the view, suppose I have a button. If I click on it, it should trigger the file download.
In my view I have:
<%= link_to 'Download File', download_file_home_path %>
In routes.rb
resources :homes, only: [:update] do
member do
get 'download_file'
end
end
In homes_controller.rb
def download_file
send_file "path/to/file.pdf"
end
When I click on the link, everything works perfectly and it triggers download. But I need a button instead of link. When I use the button_to method, it fails and I get following error:
ActionController::RoutingError (No route matches [POST] "/source_machines/4/download_report"):
actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.5) lib/rails/rack/logger.rb:20:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack-rewrite (1.5.1) lib/rack/rewrite.rb:24:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.5) lib/rails/engine.rb:518:in `call'
railties (4.2.5) lib/rails/application.rb:165:in `call'
railties (4.2.5) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.5) lib/rails/railtie.rb:194:in `method_missing'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/deflater.rb:35:in `call'
newrelic_rpm (3.16.1.320) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
puma (3.6.0) lib/puma/configuration.rb:225:in `call'
puma (3.6.0) lib/puma/server.rb:578:in `handle_request'
puma (3.6.0) lib/puma/server.rb:415:in `process_client'
puma (3.6.0) lib/puma/server.rb:275:in `block in run'
puma (3.6.0) lib/puma/thread_pool.rb:116:in `call'
puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
logging (2.1.0) lib/logging/diagnostic_context.rb:450:in `call'
logging (2.1.0) lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context'
My question is why does it works with link_to and does not work with button_to method, and what can I do to make it work with button_to

Ok, try it:
<%= button_to 'your_button_name', your_path, method: 'get' %>

Following #prashant 's comment,
This is because your route for the action is created for GET request and your link is sending GET request so it working.But button_to is sending request as POST request which is not matching to any route.
So adding method: 'get' fixed the problem.
The view should look like following:
<%= button_to 'Download Report', download_file_home_path, method: 'get' %>

Related

Rails 4 No route matches [GET] when clicking on a link to open a PDF

In my Rails 4 application, I'm showing a link to the PDF files. The user should be able to click the link and see the PDF.
What I got is the error No route matches [GET]: "/assets/documents/pdf/..."
I don't know what to do if I need to add in the routes and controller something?
My controller:
class SearchesController < ApplicationController
require 'net/http'
def index
if params[:search].present?
url = "http://localhost:3003/api/search?q=" + params[:search][:keyword]
uri = URI(url)
resp = Net::HTTP.get(uri)
#json_resp = JSON.parse(resp)
#result = #json_resp["docs"]
end
end
def search
end
end
The view:
<b>Pdf:</b> <%= link_to item["resource_name"], asset_path("/assets/documents/pdf/" + item["resource_name"]), :target => "_blank", :class => "links" %>
Log:
Started GET "/show_pdf/%2Fassets%2Fdocuments%2Fpdf%2F2018%2003%20Technical%20Conformance%20Guide%20v4.1.pdf" for 127.0.0.1 at 2018-08-07 14:34:11 +0200
ActionController::RoutingError (No route matches [GET] "/show_pdf/%2Fassets%2Fdocuments%2Fpdf%2F2018%2003%20Technical%20Conformance%20Guide%20v4.1.pdf"):
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.10) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.10) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.10) lib/rack/lock.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.10) lib/rack/sendfile.rb:113:in `call'
railties (4.2.6) lib/rails/engine.rb:518:in `call'
railties (4.2.6) lib/rails/application.rb:165:in `call'
rack (1.6.10) lib/rack/lock.rb:17:in `call'
rack (1.6.10) lib/rack/content_length.rb:15:in `call'
rack (1.6.10) lib/rack/handler/webrick.rb:88:in `service'
/Users/jakublemiszewski/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
/Users/jakublemiszewski/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
/Users/jakublemiszewski/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
Controller Action
def inline_pdf
// read the params from the routes item["resource"]
and then read the full path of the file by
// File.expand_path(item["resource"])
send_data(File.expand_path(item["resource"], disposition: 'inline', type: 'application/pdf')
end
View
<%= link_to item["resource_name"], inline_pdf_path(item["resource_name"])%>
routes
get "/inline_pdf/:name" => "controller_name#inline_pdf", as: :inline_pdf

Request.uri is empty for routes to handle?

I'm having this weird issue, where, as far as I can tell, Request isn't set, for some reason.
None of the trace is from my app, only gems, and I can't seem to figure this out. I've tried disabling gems, including newrelic, without luck.
From what I can see here, there's nothing uncommon, that would unset the Request.new env call from lib/action_dispatch/routing/redirection.rb in call?
Also worth mentioning, that this is triggered on any call, on any URL I could call from my browser, leading me to believe it has nothing to do with the code, but some gems, or my setup.
Info
Running Ruby 2.2.3
Rails 4.2.4
OS X
Stacktrace
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:17:in `rescue in split'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:14:in `split'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
/Users/***/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
actionpack (4.2.4) lib/action_dispatch/routing/redirection.rb:26:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/redirection.rb:21:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack-attack (4.4.1) lib/rack/attack.rb:107:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
http_accept_language (2.0.5) lib/http_accept_language/middleware.rb:14:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rails_event_store (0.11.0) lib/rails_event_store/middleware.rb:14:in `_call'
rails_event_store (0.11.0) lib/rails_event_store/middleware.rb:9:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
ahoy_matey (1.4.2) lib/ahoy/engine.rb:22:in `call_with_quiet_ahoy'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
request_store (1.3.1) lib/request_store/middleware.rb:9:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/***/.rvm/gems/ruby-2.2.3/bundler/gems/font_assets-457dcfddc431/lib/font_assets/middleware.rb:29:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
newrelic_rpm (3.16.0.318) lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
puma (2.16.0) lib/puma/server.rb:557:in `handle_request'
puma (2.16.0) lib/puma/server.rb:404:in `process_client'
puma (2.16.0) lib/puma/server.rb:270:in `block in run'
puma (2.16.0) lib/puma/thread_pool.rb:106:in `call'
puma (2.16.0) lib/puma/thread_pool.rb:106:in `block in spawn_thread'

Error passing time in a form when using CanCanCan

I am using the gem 'bootstrap3-datetimepicker-rails', '~> 4.17' so that the user can select a date and time, which is passed to my controller and included in the model's attributes. However, when I add load_and_authorize_resource to the controller (using cancancan), I get the following error.
argument out of range
The error is happening because it is passing the date January 27, 2015, but the date and month numbers are switched, and it doesn't like getting a date with month=27, hence the out of range error. However, this error is not happening in my controller, and the whole process works fine when I remove load_and_authorize_resource from the controller.
How can I get this working (avoiding the error) while still authorizing the controller with cancancan?
I am using Rails 4.1.4 and Ruby 2.0.0. Any guidance would be much appreciated, thanks!
Edit: Adding code.
damages/new.html.erb
<%= simple_form_for([#car, #damage], html: {class: 'create-damage-form'}) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<span class='input-group date damage-datepicker'>
<%= f.text_field :date_of_damage, class: "form-control" %>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</span>
</br>
<%= f.text_area :description, class: 'form-control form-solo-field', placeholder: 'Enter a description of the damage...' %>
</div>
<div class="form-actions">
</br>
<%= f.submit "Submit", class: "btn btn-primary btn-md" %>
</div>
<% end %>
damages_controller.rb
def create
if !params[:damage][:date_of_damage].nil?
date_of_damage = params[:damage][:date_of_damage]
else
redirect_to :back, alert: 'Enter the date of damage.'
return
end
begin
# auth_time = DateTime.strptime(auth_time, "%m-%d-%Y %H:%M%S")
date_of_damage = DateTime.strptime(date_of_damage,'%m/%d/%Y')
rescue ArgumentError => e
redirect_to :back, alert: 'Enter a valid date.'
return
end
#car = Car.find(params[:car_id])
damage_params_with_date = damage_params
damage_params_with_date[:date_of_damage] = date_of_damage
#damage = #car.damages.build(damage_params_with_date)
respond_to do |format|
if #damage.save
format.html { redirect_to #car, notice: 'Damage record was successfully added.' }
format.json { render :show, status: :created, location: #car }
else
format.html { redirect_to :back, alert: 'Damage record was not added.' }
format.json { render json: #damage.errors, status: :unprocessable_entity }
end
end
end
partner_ability.rb
can :manage, Damage, :car_id => #partner.car_ids
can :create, Damage
Stack Trace:
Started POST "/cars/1/damages" for 127.0.0.1 at 2016-01-28 22:55:22 -0500
Processing by DamagesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"gc5CPvSxAjwJfX4ekjEuJ1eZml9aoPxQWPfTBC2/kfc=", "damage"=>{"date_of_damage"=>"01/28/2016 10:55 PM", "description"=>"test"}, "commit"=>"Submit", "car_id"=>"1"}
Completed 500 Internal Server Error in 5ms
ArgumentError - argument out of range:
activesupport (4.1.4) lib/active_support/values/time_zone.rb:289:in `parse'
activesupport (4.1.4) lib/active_support/core_ext/string/zones.rb:9:in `in_time_zone'
activerecord (4.1.4) lib/active_record/attribute_methods/time_zone_conversion.rb:37:in `date_of_damage='
activerecord (4.1.4) lib/active_record/attribute_assignment.rb:45:in `_assign_attribute'
activerecord (4.1.4) lib/active_record/attribute_assignment.rb:32:in `block in assign_attributes'
activerecord (4.1.4) lib/active_record/attribute_assignment.rb:26:in `assign_attributes'
activerecord (4.1.4) lib/active_record/core.rb:455:in `init_attributes'
activerecord (4.1.4) lib/active_record/core.rb:198:in `initialize'
activerecord (4.1.4) lib/active_record/inheritance.rb:30:in `new'
cancancan (1.13.1) lib/cancan/controller_resource.rb:80:in `build_resource'
cancancan (1.13.1) lib/cancan/controller_resource.rb:61:in `load_resource_instance'
cancancan (1.13.1) lib/cancan/controller_resource.rb:32:in `load_resource'
cancancan (1.13.1) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
cancancan (1.13.1) lib/cancan/controller_resource.rb:10:in `block in add_before_filter'
activesupport (4.1.4) lib/active_support/callbacks.rb:440:in `block in make_lambda'
activesupport (4.1.4) lib/active_support/callbacks.rb:160:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
meta_request (0.3.4) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
meta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:35:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
activerecord (4.1.4) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
activerecord (4.1.4) lib/active_record/migration.rb:380:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack-contrib (1.4.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
railties (4.1.4) lib/rails/engine.rb:514:in `call'
railties (4.1.4) lib/rails/application.rb:144:in `call'
newrelic_rpm (3.14.0.305) lib/new_relic/agent/instrumentation/middleware_tracing.rb:78:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.4) lib/thin/connection.rb:53:in `process'
thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
thin (1.6.4) lib/thin/server.rb:162:in `start'
rack (1.5.5) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.5) lib/rack/server.rb:264:in `start'
railties (4.1.4) lib/rails/commands/server.rb:69:in `start'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.4) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `<main>'

Circular Dependency issue using Ruby on Rails Gem

I am currently use a rails starter kit for a project which can be found here.This allows for a simple login, home page, monitoring, etc. This starter kit uses rails 4.1.8 and ruby 2.1.3.
I am currently now trying to get the a dashboard gem to work called dashing rails. It's compatible with rails 4.0 and ruby 2.0.
I allowed authorization to my localhost by adding the appropriate path for it. I am able to get the page to show, however when I load the page it comes out incomplete but sometimes it's different. Below is a picture with the buzzwords and convergence incomplete. They should have more information in them. This package using active support and requires redis server. It also requires multiple threads.
Yes I did try the curl command.
The problem I believe has to do with some dependency issue, as stated by the log, but I am new to rails so any help with trying to resolve this issue or the cause would be greatly appreciated. Thank you!
Here is the error file
RuntimeError (Circular dependency detected while autoloading constant Dashing::WidgetsController):
activesupport (4.1.8) lib/active_support/dependencies.rb:478:in `load_missing_constant'
activesupport (4.1.8) lib/active_support/dependencies.rb:180:in `const_missing'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `const_get'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `block in constantize'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `each'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `inject'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `constantize'
activesupport (4.1.8) lib/active_support/dependencies.rb:552:in `get'
activesupport (4.1.8) lib/active_support/dependencies.rb:583:in `constantize'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:78:in `controller_reference'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:68:in `controller'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:46:in `call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/railtie.rb:194:in `public_send'
railties (4.1.8) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/flash.rb:254:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/migration.rb:380:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.8) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/rails/middleware.rb:13:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.8) lib/rails/rack/logger.rb:22:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:12:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/application.rb:144:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.10.2) lib/puma/server.rb:492:in `handle_request'
puma (2.10.2) lib/puma/server.rb:363:in `process_client'
puma (2.10.2) lib/puma/server.rb:254:in `block in run'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `call'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `block in spawn_thread'

Rescue an ActionController::BadRequest

I am running a rails app and I have a simple show action, where the code is something like the following:
#post = Post.find(params[:id])
So if you go to posts/1 for example you will see the post if there is one.
I can catch invalid params[:id] or invalid params but I noticed something strange. Somebody tried to pass me yesterday something like the following:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5;
And I am getting an ActionController bad request exception. When I am visiting the url /posts/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5; I see a blank page instead of the typical 404 I have in a similar error. I also noticed that with the param it doesn't get into posts controller show action, either to application controller (I've tried to rescue it from there as well). I suppose it is a rack exception from some gem I have and I don't know how to rescue it.
Here is my whole error response:
Started GET "/blog/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED" for 192.168.1.105 at 2014-03-18 09:45:42 +0200
ActionController::BadRequest (ActionController::BadRequest):
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:37:in `block in call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `each'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
bullet (4.7.1) lib/bullet/rack.rb:12:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__44017112__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (1.1.0) lib/better_errors/middleware.rb:58:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.7.1) lib/puma/server.rb:486:in `handle_request'
puma (2.7.1) lib/puma/server.rb:357:in `process_client'
puma (2.7.1) lib/puma/server.rb:250:in `block in run'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `call'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
Any idea how can I rescue this one with a 404 and avoid the blank page?
OK I found that if you pass something like %ED it is a 400 bad request so I just created a 400 static page and I've added the following in my exception notification:
Myapp::Application.config.middleware.use ExceptionNotification::Rack,
:ignore_exceptions => ['ActionController::BadRequest'] + ExceptionNotifier.ignored_exceptions,
:ignore_crawlers => %w{Googlebot bingbot},
:email => {
:email_prefix => "[Myapp.com Exception Notifier] ",
:sender_address => %{"myapp.com" <info#myapp.com>},
:exception_recipients => %w{myemail#myapp.com}
}

Resources