Forum: Ruby How Routing Rails?

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.
Jamal S. (Guest)
on 2007-03-27 17:48
(Received via mailing list)
Hello,

I'm trying to do develop some modules so I can reuse all my codes in
different projects.

I need to put routing in different files, and in route.rb include the
files which have my routing code, but I don't know if this would work?

Example, the following lines is inside route_account.rb.

map.login   'login',   :controller => 'accounts', :action => 'login'
map.login   'signup',   :controller => 'accounts', :action => 'signup'
map.logout   'logout',   :controller => 'accounts', :action => 'logout'
map.account 'account' :controller => 'accounts', :action => 'account'

I tried to include the line below in route.rb, but that wouldn't work?

include 'route_account.rb'
or load 'route_account.rb' or require 'route_account'

Any help would be appropriated :) and thanks

Regards,
Jamal

Thanks for your help!
Phillip G. (Guest)
on 2007-03-27 17:51
(Received via mailing list)
Yamal Khaled Soueidan wrote:
> map.login   'login',   :controller => 'accounts', :action => 'login'
>
> Regards,
> Jamal
>
> Thanks for your help!
>

http://www.rubyonrails.org/community

--
Phillip "CynicalRyan" Gawlowski

Rule of Open-Source Programming #15:

If you like it, let the author know. If you hate it, let the author
know why.
Leonard C. (Guest)
on 2007-03-28 04:34
(Received via mailing list)
When you just have the lines in route_account.rb, what do you think
that "map" refers to?
1. How Kernel#load, Kernel#require work. They do not simply "insert
text" from the supplied file. Rather, they will execute (effectively,
anyway)
2. What does "map" mean? It needs to be an instance of
Action::Controller::Routes, either though a block or a constructor.

This is really the wrong list, though. You should try
http://groups.google.com/group/rubyonrails-talk for questions like
this.
This topic is locked and can not be replied to.