E
El Gato
I know this is all possible with Rails, but I'm thinking about creating
a little app that uses WEBrick and I'd like to be able to pass instance
variables around from WEBrick to my rhtml. Does anyone know if that's
possible? For example, given this:
class Foo < HTTPServlet::ERBHandler
def initialize(server, name = "#{Dir:wd}/htdocs/foo.rhtml")
@foo = "hello"
super
end
end
...
server.mount "/foo", Foo
How could I do
-- foo.rhtml --
<html>
...
<%= @foo %>
...
</html>
Thoughts? Am I way off on even thinking this is possible. I know
webrick references the binding in the erbhandler, could I somehow
override it to use my binding instead?
a little app that uses WEBrick and I'd like to be able to pass instance
variables around from WEBrick to my rhtml. Does anyone know if that's
possible? For example, given this:
class Foo < HTTPServlet::ERBHandler
def initialize(server, name = "#{Dir:wd}/htdocs/foo.rhtml")
@foo = "hello"
super
end
end
...
server.mount "/foo", Foo
How could I do
-- foo.rhtml --
<html>
...
<%= @foo %>
...
</html>
Thoughts? Am I way off on even thinking this is possible. I know
webrick references the binding in the erbhandler, could I somehow
override it to use my binding instead?