I am having problem with routes.rb I want to access same page using two different url''s for that i had done following in routes.rb 1] map.connect ''projects/:project_id/issues/:action'', :controller => ''issues'' so when my url is http://localhost:3000/projects/xyz/issues/new i access the new.rhtml page of a issue controller what i want that when i write simply http://localhost:3000/issues/new it should render me to the action new of a issues controller. i try something like this in routes.rb map.connect ''issues/:action'', :controller => ''issues'', :action=>''new'' and then restart the server but it doesn''t works.... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Why not just map.resources :issues and go from there? That is a RESTful resource, right? On Mar 6, 8:39 am, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I am having problem with routes.rb > > I want to access same page using two different url''s for that i had done > following in routes.rb > 1] map.connect ''projects/:project_id/issues/:action'', :controller => > ''issues'' > so when my url ishttp://localhost:3000/projects/xyz/issues/new > > i access the new.rhtml page of a issue controller > > what i want that when i write simply > > http://localhost:3000/issues/newit should render me to the action new > of a issues controller. > > i try something like this in routes.rb > > map.connect ''issues/:action'', :controller => ''issues'', :action=>''new'' > > and then restart the server but it doesn''t works.... > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Where does the application take you when you go to /issues/new? You can always comment out other routes until you find the one that is causing the conflict... --Tom On Mar 6, 9:39 am, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I am having problem with routes.rb > > I want to access same page using two different url''s for that i had done > following in routes.rb > 1] map.connect ''projects/:project_id/issues/:action'', :controller => > ''issues'' > so when my url ishttp://localhost:3000/projects/xyz/issues/new > > i access the new.rhtml page of a issue controller > > what i want that when i write simply > > http://localhost:3000/issues/newit should render me to the action new > of a issues controller. > > i try something like this in routes.rb > > map.connect ''issues/:action'', :controller => ''issues'', :action=>''new'' > > and then restart the server but it doesn''t works.... > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Can you show us your rake routes to see what you have defined? On Mar 6, 12:21 pm, tomrossi7 <t...-5bxIUPmzHicFraO2wh7vUA@public.gmane.org> wrote:> Where does the application take you when you go to /issues/new? You > can always comment out other routes until you find the one that is > causing the conflict... > --Tom > > On Mar 6, 9:39 am, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > I am having problem with routes.rb > > > I want to access same page using two different url''s for that i had done > > following in routes.rb > > 1] map.connect ''projects/:project_id/issues/:action'', :controller => > > ''issues'' > > so when my url ishttp://localhost:3000/projects/xyz/issues/new > > > i access the new.rhtml page of a issue controller > > > what i want that when i write simply > > >http://localhost:3000/issues/newitshould render me to the action new > > of a issues controller. > > > i try something like this in routes.rb > > > map.connect ''issues/:action'', :controller => ''issues'', :action=>''new'' > > > and then restart the server but it doesn''t works.... > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
On Mar 6, 7:39 pm, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I am having problem with routes.rb > > I want to access same page using two different url''s for that i had done > following in routes.rb > 1] map.connect ''projects/:project_id/issues/:action'', :controller => > ''issues''you should always use.. RESTful routes.. instead of above try this: map.resources :projects, :has_many => :issues --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Salil Gaikwad wrote:> i try something like this in routes.rb > > map.connect ''issues/:action'', :controller => ''issues'', :action=>''new'' > > and then restart the server but it doesn''t works....Try this in irb>> rts = ActionController::Routing::Routes >> rts.recognize_path("issues/new")and it''ll return the route that maps to it This and other cool tips in a nice tutorial by Daryn Holmes: http://darynholmes.wordpress.com/2008/03/15/beginners-tutorial-routing-in-rails-20-with-rest-part-1-of-n/ Sarah -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---