Skip to content

Instantly share code, notes, and snippets.

@emiltin
Created July 4, 2012 16:24
Show Gist options
  • Select an option

  • Save emiltin/3048145 to your computer and use it in GitHub Desktop.

Select an option

Save emiltin/3048145 to your computer and use it in GitHub Desktop.
#routes.rb
RailsOSRM::Application.routes.draw do
scope "(:locale)"
resources(:issues)
end
end
#issues_controler.rb
def test
@issue = Issue.find params[:id]
end
#test.hmtl.erb
<%= link_to 'view', @issue %>
# =>
No route matches {:action=>"show", :controller=>"issues", :locale=>#<Issue id: 1, user_id: 32, title: "blue sky", body: "missing", status: nil, comments_count: 1, votes_count: 1, created_at: "2012-06-26 17:36:03", updated_at: "2012-06-26 17:36:03">}
how did an Issue object end up in :locale option to link_to?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment