We are using ActiveAdmin in our Rails3 application for the default models. Now we needed to overwrite the show action. The OrderProcess model is a transient (tableless) model, which means that all fields are aggregated from other data. We use an internal module that provides the necessary methods to mock the MetaSearch methods ActiveAdmin is depending on. The following is how we overwrite the show action:
ActiveAdmin.register OrderProcess do
member_action :show, :method => :get do
@order_process = OrderProcess.all_orders_for_deal(params['id'])
end
end
That gives us an error complaining about a missing template "Missing template admin/order_processes/show with ..."
We also tried to call
render renderer_for(:show)
but that produced an error about a missing method model_name which may be due to our model being tableless and the regarding module.
How can we use ActiveAdmins built in rendering methods to display our model? Any help is appreciated.
Just ran into this... Grant's comment is correct, active_admin_template
doesn't exist any more (I'm on 1.0.0-pre2).
I ended up going with:
render :action => :edit, :layout => false
which seems to work, although you will have to supply a label for the header, which displays as "translation missing: en.active_admin.[your_action]_model"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With