Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add views for custom member action in active admin?

I have to add view for custom action which is member action, and want to display association records on it. Is there way to add custom view instead of just adding html.erb in admin's view folder?

I dont want to add or create html files but by using the active admins helpers.

like image 553
jbmyid Avatar asked Sep 02 '25 16:09

jbmyid


1 Answers

The member action in nothing else like a controller action, thats mean you can do the same things in it.

You can use thinks like:

render text: "Hello world!"

Or if you want a complex markup:

message1 = "Hello"
@message2 = "world!"
view = Arbre::Context.new(message: message, self) do
  h1 do
    span message
    span @message
  end
end
render body: view.to_html # or .to_s
like image 69
Timo Schilling Avatar answered Sep 05 '25 09:09

Timo Schilling