Page_type as a parameter

I am trying to pass a page_type parameter (via query string) to the page
controller new and create actions.

http://localhost:3000/admin/pages/5/children/new?page_type=event

The goal is for the new page to appear showing it’s page type-specific
fields already. Normally, when creating a new page you click the add
button on the page index, you arrive at the new page screen, you select
the page type and AFTER you click “Create Page” you finally end up with
the page in its typed glory.

The thing I’m trying to avoid is having the user save the page in two
steps. 1) Create a basic page setting the type before saving, 2) When
the page reloads fill out the type-specific fields and save again.

It’s easy enough to add a feature to the page index that allows for page
type selection and invokes the page#new action with a page type. I have
attempted to mixin some modules into Admin::ResourceController and
Admin::PagesController with limited success.

I was looking for the least obtrusive way to do this, but after lots of
failed attempts, I’m less concerned with how obtrusive/clean the change
is.

I would have thought this fairly simple but after 3 hours it’s seeming
less simple. Any ideas?

Admin::PagesController.class_eval do
alias old_new new
alias old_create create

def new
puts ‘i made it to new’ #=> seeing this
klass = params[:page_type].camelize.constantize rescue model_class
self.model = klass.new_with_defaults(config)
if params[:page_id].blank?
self.model.slug = ‘/’
end
response_for :singular
end

def create
puts ‘i made it to create’ #=> not seeing this
model.update_attributes!(params[model_symbol])
announce_saved
response_for :create
end
end

I’m using Radiant 0.8.1.

Thanks,
Mario T. Lanza