[Radiant] Access to params within extension

Loren Johnson loren at fn-group.com
Mon Jan 22 01:09:38 CST 2007


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 Sheppard wrote:

> If you've made a custom route, then that route will be handled by a
> regular rails controller, not a page object.

Loren Johnson
loren at fn-group.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20070122/32bc4715/attachment.html


More information about the Radiant mailing list