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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

UPDATE: PROBLEM SOLVED. Moved the “}” after the parameters in the link and things began working again. It isn’t clear why it stopped working and started working again but here is the change.

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

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.