1

I'm having an issue while trying to append multiple actions in the index page in activeadmin.

I used this code to append two actions in activeadmin.

actions defaults: false do |resource|
  item "View", resource_path(resource)
  unless resource.approved?
    item "Edit", edit_resource_path(resource)
  end
end

The problem is the links appear next to each other like this

ViewEdit

Next thing I did was add a space using text_node which resulted in this

actions defaults: false do |resource|
  item "View", resource_path(resource)
  text_node " "
  unless resource.approved?
    item "Edit", edit_resource_path(resource)
  end
end

This gave me this output:

View
Edit

What I'm trying to figure out is how I get to display these two links next to each other.

Any ideas ?

koko1
  • 19
  • 5

1 Answers1

4

Add the class member_link

actions defaults: false do |resource|
  item "View", resource_path(resource), class: 'member_link'
  unless resource.approved?
    item "Edit", edit_resource_path(resource), class: 'member_link'
  end
end
T J
  • 1,312
  • 7
  • 7