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

Passing params to import #130

Closed
Jamevidi opened this issue Feb 2, 2017 · 5 comments
Closed

Passing params to import #130

Jamevidi opened this issue Feb 2, 2017 · 5 comments

Comments

@Jamevidi
Copy link

Jamevidi commented Feb 2, 2017

How about passing params to the import? So the web interface could hook up with the import.

How about something like this:

# importer.rb
   # add attr_reader
    attr_reader :params

   # pass params:
    def initialize(resource, model, options, params)
      @params = params
# dls.rb 
    # pass params:
     @importer = Importer.new(options[:resource_class], @active_admin_import_model, options, params)

Just an idea.

@Fivell
Copy link
Member

Fivell commented Feb 2, 2017

@Jamevid , it is already done
take a look

@active_admin_import_model.assign_attributes(params[params_key].try(:deep_symbolize_keys) || {})

@Fivell
Copy link
Member

Fivell commented Feb 2, 2017

@Fivell
Copy link
Member

Fivell commented Feb 2, 2017

I opened access to wiki so everyone can contribute now

@Fivell Fivell closed this as completed Feb 2, 2017
@Jamevidi
Copy link
Author

Jamevidi commented Feb 2, 2017

Thanks for super fast answer ! 👍

@Jamevidi
Copy link
Author

Jamevidi commented Feb 5, 2017

Aaaah. I got it now.

template_object would be used for just this. :-)

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

2 participants