Skip to content

Loading…

Compatibility issue with pry-rails < 0.1.6. (was default_actions doesn't render anything) #983

Closed
kostia opened this Issue · 13 comments

5 participants

@kostia

Hi there,

following code-snippet doesn't render any action buttons in action menu in the top right corner:

ActiveAdmin.register(Category) do
  menu(:priority => 1)

  filter(:title)
  filter(:name)
  filter(:created_at)
  filter(:updated_at)

  index do
    column(:title)
    column(:name)
    column(:created_at)
    column(:updated_at)

    default_actions
  end
#...

Same in the show page.

  • Rails-3.2.1
  • ActiveAdmin-0.4.0

Kind regards!
Kostia

@bbatsov

I was just about to report that issue myself. ActiveAdmin used to work fine before an update to Rails 3.2.1 and ActiveAdmin 0.4 - now the buttons produced by default_actions are gone everywhere.

@mattvague

Hey guys,

The naming might be a bit confusing, but default_actions doesn't actually control the action buttons in the top right corner it controls the "View | Edit | Delete" action links beside each table row. Removing it would remove those links.

Are you saying the buttons aren't showing up at all for you guys? Are you by any chance using config.clear_action_items!?

@kostia

The naming might be a bit confusing

Sorry about confusion.
Both ("View | Edit | Delete" in the table rows and the buttons from action menu) doesn't appear anymore. Of course default_actions renders only the links on the index page. But it might be a hint, that also the "Edit | Delete" button in the top right corner on the show page doesn't appear anymore.

Are you by any chance using config.clear_action_items!?

No, I don't.

@mattvague

Hmm, there are a few reports of this now. What version of Ruby/Rails/ActiveAdmin are you using?

@kostia
  • Rails-3.2.1
  • ActiveAdmin-0.4.0
  • Ruby-1.9.3-p0 (Rbenv on OSX)

Also: Formtastic-2.0.2

@mattvague

Duh, just noticed you said that above sorry haha. When did this start happening for you?

@kostia

Before update:

  • Rails-3.1.3
  • ActiveAdmin-0.3.4

After update:

  • Rails-3.2.1
  • ActiveAdmin-0.4.0

Same Rubies. The reason for update was Rails-3.2 :-)

@bbatsov

My environment is exactly the same, the problem - as well. The column with the buttons generated by default_actions is missing in index views and so are Edit and Delete buttons in the show views.

@nbeloglazov

I have the same problem. I also use pry-rails gem and it seems that it causes this weird behavior. If you use it, try to disable it and check if it works now. Or update to latest pry-rails - 0.1.6
Problem that pry-rails extends Object class with methods from module Rails::ConsoleMethods. One of the methods is controller methods, which return instance of ApplicationController. But controller method is used by active_admin so it gets wrong controller.
And this extending is enabled only in rails 3.2.x and higher.

@kostia

Thanks a lot, Nikita! I can confirm, that it fixed the problem :-)

@bbatsov

@nbeloglazov Thanks a lot! I never imagined that pry-rails was involved at all. @kostia Maybe you should close the issue?

@pcreux pcreux was assigned
@pcreux

I will add pry-rails >= 0.1.6 to the dependency checker.

@pcreux

Closed by 8d604ec.

@pcreux pcreux closed this
@pcreux pcreux was unassigned by kostia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.