Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown actions for index #2767

Closed

Conversation

lporras
Copy link
Contributor

@lporras lporras commented Dec 5, 2013

When adding many custom actions using index as table you get a large column for actions. This adds a 'dropdown' option to actions method in order to display the actions in a dropdown menu

Some Examples:

To list default actions and customs actions:

index do
  selectable_column
  column :title
  actions dropdown: true do |post|
    item "Preview", admin_preview_post_path(post)
  end
end

To list custom actions without default_actions:

index do
  selectable_column
  column :title
  actions dropdown: true, default: false do |post|
    item "Preview", admin_preview_post_path(post)
  end
end

Preview:

screen shot 2013-12-06 at 10 51 00 am

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.25%) when pulling 283d61e on lporras:dropdown-actions-for-index into 388ed07 on gregbell:master.

And I should not see a dropdown menu item to "Delete"
And I should see a dropdown menu item to "Custom Action"

Scenario: Actions without default actions within a dropdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you repurposed an existing test, but there should really be three different tests:

# 1
actions defaults: false
# 2
actions dropdown: true
# 3
actions dropdown: true, defaults: false

@seanlinsley
Copy link
Contributor

(ping)

@seanlinsley
Copy link
Contributor

Closing due to inactivity :<

@lporras lporras deleted the dropdown-actions-for-index branch February 1, 2014 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants