Skip to content

required)>': undefined method `xlsx' for #<ActiveAdmin::ResourceDSL:0x007fca01d1fdd0> (NoMethodError) #4

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

Closed
warpc opened this issue Feb 14, 2013 · 6 comments

Comments

@warpc
Copy link

warpc commented Feb 14, 2013

Hi!

Thanks for usefull gem and your work.

I have some strange problem with gem. I install it, it work. I customize xlsx for own needs and it work without problem when application run in devel mode. But if stop application and try to start it: i get such error:

 app/admin/orders.rb:55:in `block in <top (required)>': undefined method `xlsx' for #      <ActiveAdmin::ResourceDSL:0x007fca01d1fdd0> (NoMethodError)
 gems/activeadmin-0.5.1/lib/active_admin/dsl.rb:16:in `instance_eval'
 gems/activeadmin-0.5.1/lib/active_admin/dsl.rb:16:in `run_registration_block'
 gems/activeadmin-0.5.1/lib/active_admin/namespace.rb:175:in `parse_registration_block'

Any idea how fix it?

rails (3.2.12), activeadmin (0.5.1), activeadmin-axlsx (2.0.0)

@randym
Copy link
Owner

randym commented Feb 17, 2013

I'll have a look. Thank you for reporting this.

@Fivell
Copy link

Fivell commented Mar 7, 2013

I fixed it by changing after_initialize to before_initialize

@warpc
Copy link
Author

warpc commented Mar 7, 2013

@Fivell Thanks, it works!

What made in detail: change https://github.com/randym/activeadmin-axlsx/blob/master/lib/active_admin/axlsx.rb#L9 from after_initialize to before_initialize as recomend by @Fivell and all work now.

@Gerald1985
Copy link

Hi, I was having the same issue, thanks @Fivell it works.
@radym would you please assist with an update to not override the code.
It crashed at starting the server undefined method `xlsx' for #<ActiveAdmin::ResourceDSL.

Thanks :)

@randym
Copy link
Owner

randym commented Mar 21, 2013

Well done @Fivell !
2.0.1 will be on Rubygems shortly.

@Jamevidi
Copy link

Below version seems to work really well with the "xlsx do...end" - DSL (I just cant get params)
gem 'activeadmin-axlsx', '2.0.1'

I have tried many other versions of activeadmin-axlsx together with different versions of activeadmin the dsl seems to break for me after this commit 06b16f8

DeeMak13 added a commit to DeeMak13/activeadmin-axlsx that referenced this issue Mar 1, 2016
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

No branches or pull requests

5 participants