By RedMagnum30
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!
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"%>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.