If you want your URLs to look a certain way, that’s normally entirely
the concern of the routing, generally configured in routes.rb. You could
certainly have routes set up that allow requests to end in “.rhtml”
(although why you’d want to I don’t know), but they’d still be routed to
controllers. Because that’s how Rails MVC works.
But you want a URL that looks like
“http://domain/somefolders/somepage.rhtml” to just map to a file on disk
in public/somefolders.somepage.rhtml, and then just call that “rhtml”
file kind of like PHP works?
I don’t think you want Rails. There might be some way to make that
happen in Rails, but it’s pretty antithetical to the entire architecture
of Rails. If you really want to do that, perhaps there’s another ruby
web architecture (other than Rails) that will do that. Personally, I
think it’s probably a bad idea though.
If you want to let your designers edit the .rhtml views themselves
directly, that could be fine, but leave them in /app/views! Why not?
thanks Jean, yes i understand your point and i agree it’s better to do
it the proper way.
one other reason this question came to my mind is that i think i’ve
seen on some website (though i don’t recall the exact site names now)
with url’s ending with a “.rhtml”, and i thought maybe this can be
like jsp / asp / php it could be used casually, on a page by page
basis as well.
with your solution “render :file => path” the controller is still the
central point of the request. i’m thinking, technically, can i have
something like http://domain/somefolders/somepage.rhtml ? i mean, not
thru the rails routing but rather somefolders/sompage.rhtml are simply
within /public. (though not a good practice, but this should be
technically feasbile shouldn’t it?)
On Sep 20, 11:37 pm, Jean N. [email protected]