Hmmm… seems that tags ARE instance_eval’d on the page, so ignore my
last email. You’re after params as interpreted by controllers. I think
those are available with @request.path_parameters
From: [email protected]
[mailto:[email protected]] On Behalf Of Loren J.
Sent: Monday, 22 January 2007 6:10 PM
To: [email protected]
Subject: Re: [Radiant] Access to params within extension
No, I get that. Here is my custom route:
map.connect ‘event-calendars/:calendar_group/:calendar/:period’,
:controller => ‘site’, :action => ‘show_page’, :url => ‘calendar’
So I’m forward the control back to the Radiant Site controller.
My question is within the Page type which I attach to the real
Radiant page found at “/calendar” how can I cleanly access the url
params ? This is how I solved it for now, but it’s ugly and inflexible:
class EventCalendar < Page
…
tag “calendar” do |tag|
path = @request.request_uri.split(“/”)
p = Hash[:calendar_group => path[2], :calendar => path[3],
:period => path[4]]
…
end
end
Just hoping to find a better way.
Thanks,
On Jan 21, 2007, at 11:52 PM, Daniel S. wrote:
If you've made a custom route, then that route will be
handled by a
regular rails controller, not a page object.
Loren J.
[email protected]