Comments (14)
Hi @unenemy
Can you let me know a bit more about how you are doing this?
For example, are you trying to configure this in ActiveAdmin.register [Model] block?
Somewhere in a controller?
More than happy to help out, and fix anything that may be broken, I just need to be able to recreate the problem and dig in.
from activeadmin-axlsx.
Okay, I register a Model like this:
ActiveAdmin.register Order, :as => "OrderStatistics" do
end
And xlsx works perfectly, loads an xlsx file with all the field, thats nice.
But when I tried customize it. My customization ended with:
ActiveAdmin.register Order, :as => "OrderStatistics" do
xlsx do
end
end
After adding this 2 lines it gives me those errors.
Thanks for quick reply :)
PS: does that matters, my active_admin version is "0.5.0"?
from activeadmin-axlsx.
Please have a look at the readme for this gem. configuration is done via the config builder object. I am not quite sure where you are getting that 'xlsx' from. Perhaps there is some reference out there that I dont know about giving the wrong information?
from activeadmin-axlsx.
I found this in your code. That's where I get info about xlsx method
module ActiveAdmin
module Axlsx
module DSL
# Configure the xlsx format
#
# For example:
#
# xlsx do
# i18n_scope = [:active_admin, :resources, :post]
# column :name
# column(:author) { |post| post.author.full_name }
# end
#
# xlsx :header_style => { :bg_color => "00", :fg_color => "FF" } do
# column :name
# end
def xlsx(options={}, &block)
config.xlsx_builder = XlsxBuilder.new(options, &block)
end
end
end
end
Besides, I have another problem. I tried out the config builder object and it worked fine. I added it this way
ActiveAdmin.register Currency do
config.xlsx_builder.column('test') do
"test"
end
#xlsx do
#end
end
BUT. After I tried restart my server, I've got an error:
undefined method `xlsx_builder' for #ActiveAdmin::Resource:0xbd5b62c (NoMethodError)
I'm sorry for giving you my troubles, but I really need configure output file ( remove some columns, add another columns (using config I can do only adding new)).
Thanks.
from activeadmin-axlsx.
Well done mate!
Please accept my sincerest apologies for providing the only thing worse than no documentation: bad documentation!
In the short term, can you use the config.axlsx_builder blocks like the README shows?
I am fairly sure you have access to the columns collection and can hack on that without issue.
I'll have a look at that DSL tomorrow and see what is going on (JST here, so time for bed soon!)
from activeadmin-axlsx.
Yeap, I can hack that with axlsx_builder, but I'm very waiting for dsl :)
Thanks and good night :)
from activeadmin-axlsx.
Some goodies coming for us soon. Any chance I can encourage you to do some testing against master?
from activeadmin-axlsx.
Thanks a lot, that's was fast. For now, that's all I've found.
from activeadmin-axlsx.
Hi!
I also have this problem: #4
Do you need any additional informations?
from activeadmin-axlsx.
Does it happen in master?
from activeadmin-axlsx.
Hi!
Yes, i insert Gemfile in:
gem 'activeadmin-axlsx', :git => "[email protected]:randym/activeadmin-axlsx.git"
Use bundle install and try to run application using rails s
orders.rb:63:in `block in <top (required)>': undefined method `xlsx_builder' for # <ActiveAdmin::Resource:0x007fad6cc205a8> (NoMethodError)
In this file this code is:
xlsx do
I try use
config.xlsx_builder.delete_columns :id, :created_at, :updated_at
and also get error:
7:in `block in <top (required)>': undefined method `xlsx_builder' for #<ActiveAdmin::Resource:0x007fbb7af22780> (NoMethodError)
from activeadmin-axlsx.
Thank you very much! I'll try and have a look at this tomorrow morning.
from activeadmin-axlsx.
Hi. Do you need any additional informations or help with testing changes?
from activeadmin-axlsx.
@randym, please look it: #4 (comment)
from activeadmin-axlsx.
Related Issues (20)
- Trailing zeros in column values HOT 1
- Custom helpers not being included, compass watch produces an error. HOT 1
- Active Admin scoped_collection HOT 2
- get data for pivot table from another sheet in after_filter hook HOT 1
- Not working with AA 1.0.0.pre HOT 3
- Breaking Routes
- Gemfile incompatible with activeadmin master/pre branch HOT 1
- `require': cannot load such file -- activeadmin/axlsx (LoadError) HOT 1
- wrong number of arguments (1 for 0) HOT 14
- "wrong number of arguments (1 for 0)", activeadmin (1.0.0.pre) ruby 2.1.2 and rails 4.1.5 HOT 2
- undefined local variable or method `max_csv_records' in AA 1.0.0.pre HOT 3
- The way to make activeadmin-axlsx work with newest ActiveAdmin 1.0 Rails4 (Tested) HOT 1
- Using only filtered elements in the excel download
- Using activeadmin-axlsx with ActiveAdmin version 1.0.0.pre1 causes a crash HOT 4
- two issues with devise
- index_without_xlsx(options) fails with wrong number of arguments (1 for 0) HOT 1
- 2.0.1 seems to break font-awesome-rails
- Excel cant open this file format error
- dependency was wrong
- Installation dependency axlsx is not recognized
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activeadmin-axlsx.