Forum: Ruby on Rails Routing and extensions.

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.
Cc49c230d235b54ab3cbc04d47b1eec9?d=identicon&s=25 K. adam Christensen (pope)
on 2006-04-25 19:38
I would like my something like "my_page.html" to map to :controller =>
'page', :action => 'my_page'.  How can I accomplish that?

Is there a way to make the routing parse other things other than '/'?
Cc49c230d235b54ab3cbc04d47b1eec9?d=identicon&s=25 K. adam Christensen (pope)
on 2006-04-26 17:14
K. Adam Christensen wrote:
> I would like my something like "my_page.html" to map to :controller =>
> 'page', :action => 'my_page'.  How can I accomplish that?
>
> Is there a way to make the routing parse other things other than '/'?

What I have done is perform some checking in the controller to get this
to work.  This feels sloppy.  Does anyone have any other ideas?

I'm trying to integrate an old site that used php and other html pages
to ruby, and I don't want to have to change all of the links and
whatnot, because there is legacy there.
Cc49c230d235b54ab3cbc04d47b1eec9?d=identicon&s=25 K. adam Christensen (pope)
on 2006-04-27 16:11
bump
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-04-27 17:02
map.connect '/mypage/mypage.html', :controller => "mypage", :action =>
"mypage"
Cc49c230d235b54ab3cbc04d47b1eec9?d=identicon&s=25 K. adam Christensen (pope)
on 2006-04-27 17:09
Mohammad wrote:
> map.connect '/mypage/mypage.html', :controller => "mypage", :action =>
> "mypage"

is there a way to do that where in the first argument of
'/mypage/mypage.html', something like '/:controller/:action.html'(which
doesn't work). I can use a variable of some sort.  I do not want to
re-map all of the pages on this site like that.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-04-27 17:13
K. Adam Christensen wrote:
> Mohammad wrote:
>> map.connect '/mypage/mypage.html', :controller => "mypage", :action =>
>> "mypage"
>
> is there a way to do that where in the first argument of
> '/mypage/mypage.html', something like '/:controller/:action.html'(which
> doesn't work). I can use a variable of some sort.  I do not want to
> re-map all of the pages on this site like that.
map.connect '/mypage/:action', :controller => "mypage"
now for making :action.html I would see if that works it might. But
:action is a hash so it might take it as a command so...
This topic is locked and can not be replied to.