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

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, {: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.

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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, {:controller => 'business', :action => 'profile' ,  :id => dba.site_link, :uid => dba.unique_id}, :class => "blue-orange-link", :target => "_blank"%>