Mk 27 wrote:
Marnen Laibow-Koser wrote:
Mk 27 wrote:
If I want to link from/redirect via the index page (which I notice will
not process as erb)
Huh? What won’t process as ERb?
Right. The public directory is for static assets. If you want a
dynamic index page, then use map.root in routes.rb.
Anyway, I am sure I will get to know all the rails commands eventually,
but since all the paths are absolute relative to one another, I would
actually PREFER to know what they are/should be – you cannot get
simpler than typing a relative url, eg. it would literally be
“app/views/section/list” (although this does not work).
This is a bad idea. I know it may seem simpler, but it really isn’t.
The reason is that Rails controls URL mapping through the routes.rb
file, so the URLs are not necessarily directly related to the object
structure of the application. Specifying literal URLs will bypass a lot
of the routing logic, which is generally not what you want.
Ease of use is
one thing, pointless opacity is another.
This is not pointless opacity. It exists so you can provide nice URLs
to your users without having to expose implementation details that users
So, can I ask that question again in the hopes of getting a real answer?
Learn how routing works in Rails (the rdoc is excellent on this topic).
That’s the only real answer that I or anyone else can give you.
I will investigate url_for and routes as well…