Hi,
99% of my site is rails, but I have a tiny php section I just cant
get rid of (phpbb3). I''ve turned on server-side includes on my site and
my
phpbb3 template starts with this:
<!--#include virtual="/main/header" -->
...
The problem is, rails isn''t recognizing that it was called as
"/main/header"; I get this error in my development.log:
ActionController::RoutingError (no route found to match
"/forum/index.php"
with {:method=>:get}):
Does anybody know how to get around this? I was thinking of just
adding a "/forum/*" route to explicitly point to the header, but then
there''s the problem of the footer... Any ideas would be greatly
appreciated.
:-)
Thanks,
Tyler
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Tyler MacDonald
2007-May-25 01:48 UTC
Inelegant solution found - Re: [Rails] Calling rails from a server-side include?
Okay, after hacking around a bit, I figured something out, but it''s
REALLY
hacky. :-)
Step #1: Include this code when rails starts up:
module ActionController
class CgiRequest < AbstractRequest
alias old_request_uri request_uri
def request_uri
if params[''RAILS_ROUTE'']
if Array === params[''RAILS_ROUTE'']
return params[''RAILS_ROUTE''][0]
else
return params[''RAILS_ROUTE'']
end
else
return old_request_uri
end
end
end
end
Step #2: reference rails from SSI this way:
<!--#include virtaul="/dispatch.fcgi?RAILS_ROUTE=/main/header"
-->
This is fragile and hacky, but it works for what I need!
Cheers,
Tyler
Tyler MacDonald <google.com-oTuY4Vk9bUDG8MNy1oJpyw@public.gmane.org>
wrote:>
> Hi,
>
> 99% of my site is rails, but I have a tiny php section I just cant
> get rid of (phpbb3). I''ve turned on server-side includes on my
site and my
> phpbb3 template starts with this:
>
> <!--#include virtual="/main/header" -->
> ...
>
> The problem is, rails isn''t recognizing that it was called as
> "/main/header"; I get this error in my development.log:
>
> ActionController::RoutingError (no route found to match
"/forum/index.php"
> with {:method=>:get}):
>
> Does anybody know how to get around this? I was thinking of just
> adding a "/forum/*" route to explicitly point to the header, but
then
> there''s the problem of the footer... Any ideas would be greatly
appreciated.
> :-)
>
> Thanks,
> Tyler
>
> >
--
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---