Controller Problem

View: New views
2 Messages — Rating Filter:   Alert me  

Controller Problem

by Vinay-29 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
I am new to this ruby on rails talk. and also fairly new to rails. As
i was working on controller i had faced a new problem. I created a
controller like
script/server generate controller Home::hello index
and one more controller like
script/server generate controller Home hello
and their respective view pages
my question is when i type the url like http://localhost/home/hello
why is the action inside the first controller is always called  and if
i want to call the action of my second controller what do i need to
type in the url


Thanks in Advance
Vinay

--~--~---------~--~----~------------~-------~--~----~
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Controller Problem

by Frederick Cheung-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On Nov 11, 5:02 am, Vinay <eazee...@...> wrote:

> Hi,
> I am new to this ruby on rails talk. and also fairly new to rails. As
> i was working on controller i had faced a new problem. I created a
> controller like
> script/server generate controller Home::hello index
> and one more controller like
> script/server generate controller Home hello
> and their respective view pages
> my question is when i type the url likehttp://localhost/home/hello
> why is the action inside the first controller is always called  and if
> i want to call the action of my second controller what do i need to
> type in the url

Well you've created an ambiguous set of urls there. Reordering the
corresponding declarations in routes.rb might make rails pick one over
the other, but really I'd recommend you come up with names that don't
result in ambiguous urls.

Fred
>
> Thanks in Advance
> Vinay
--~--~---------~--~----~------------~-------~--~----~
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---