Hello,

I have problem with routes in my gem. I have this example code for
adding routes :
module ActionDispatch::Routing
class Mapper
def gallery_for
match "/gallery/get/:id" => "gallery/
view#get", :as=>:gallery_galleries_by_user_id
end
end
end
And I'm trying to test it by :
class RoutestTest < ActionController::TestCase
test 'map gallery get' do
puts Rails.application.routes.routes
assert_routing '/gallery/get/1', :controller => "gallery/
view", :action => "get"
end
end
I added puts Rails.application.routes.routes to see routes. Then I try
to test it I get :
/gallery/get/:id(.:format) {:controller=>"gallery/
view", :action=>"get"}
E

Error:
test_map_gallery_get(RoutestTest):
ActionController::RoutingError: No route matches "/gallery/get/1"
What I'm doing wrog or is it any rails bug ?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 23, '11 at 9:37p
activeOct 23, '11 at 9:37p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Pemeon: 1 post

People

Translate

site design / logo © 2021 Grokbase