Report this

What is the reason for this report?

Rails error: ActionView::Template::Error (No route matches

Posted on April 5, 2015

I have one route in my Rails 4 application that is no longer working. It works in my development environment and use to work in my production environment but no longer does.

The error looks like:

ActionView::Template::Error (No route matches {:action=>"profile", :controller=>"business"}):

It occurs in my business/profile view on this line, which use to work.

<%=link_to dba.name, {:controller => 'business', :action => 'profile' },  :id => dba.site_link, :uid => dba.unique_id, :class => "blue-orange-link", :target => "_blank"%>

By the way, I’ve moved the “}” to follow “:uid=>dba.unique_id” as well and that didn’t resolve the issue.

I raked my routes and it does display route.

get '/business/profile/:id/:uid'   => 'business#profile'

I’ve searched and can’t find anything similar to my issue. Typically the answers involved making sure the route was defined, which isn’t my problem. I downloaded my app from my server just to search it to ensure there were no naming conflicts. Any suggestions would be appreciated.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.