Forum: Ruby on Rails Routing Problem please help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A389bb4071a56e944ee753a51ccd4aa7?d=identicon&s=25 Sameera Gayan (sameera)
on 2008-12-15 11:11
Hi all,

I'm creating a REST API for one of my projects and I'm stuck in a
routing issue.

I have a resource called mobileowner (which will send the user xml when
given the mobile no)

And my controller is in the following path

app -> controllers -> api -> mobileowner.

so can someone tell me how to configure this in my routs.rb file. (to
work mobileowner as a resource).

I'm using rails 2.0.2

thankx in advance

cheers
sameera
2d8132658d56e51f19ace1c68e48b6aa?d=identicon&s=25 Thorsten Mueller (thorsten)
on 2008-12-15 11:19
(Received via mailing list)
map.namespace :api do |api|
    api.resources :mobileowners
end

should be all you need.
A389bb4071a56e944ee753a51ccd4aa7?d=identicon&s=25 Sameera Gayan (sameera)
on 2008-12-15 11:51
Thorsten Mueller wrote:
> map.namespace :api do |api|
>     api.resources :mobileowners
> end
>
> should be all you need.

Hi Thorsten,

Thats IT :))))

it worked..... thankx you saved my day

thankx again

cheers
sameera
This topic is locked and can not be replied to.