GithubHelp home page GithubHelp logo

sourcelabsllc / administrate_batch_actions Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 92 KB

Batch actions for Administrate plugin

License: MIT License

Ruby 73.69% Shell 0.39% JavaScript 6.68% HTML 17.12% CSS 2.12%

administrate_batch_actions's People

Contributors

andreibondarev avatar dependabot[bot] avatar source-labs-llc avatar yorzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

administrate_batch_actions's Issues

Ruby 2.7.5, Rails 6.1.4.4, Administrate 0.16.0 undefined batch_action_name

The controller method SitesController#export_batch_action is undefined when rendering app/views/admin/application/index.html.erb

Context: Ruby 2.7.5, Rails 6.1.4.4, Administrate 0.16.0

Comparing all changes between main and administrate_batch_actions branches:
https://github.com/stepheneb/wts-rails6/compare/main...administrate_batch_actions

ActionView::Template::Error (undefined local variable or method `export_batch_action' for #<ActionView::Base:0x0000000000b2c0>
Did you mean?  export_batch_action_admin_sites_url):
    34: 
    35:   <%=
    36:     administrate_batch_actions_button(
    37:       export_batch_action,
    38:       export_batch_action_admin_sites_path,
    39:       { class: '', confirm: '' }
    40:     )
  
app/views/admin/application/index.html.erb:37

In the interactive console under the view error and asking for tab completion on in-scope objects starting with export.

>> export 
export_batch_action_admin_sites_path export_batch_action_admin_sites_url

My controller with a method named: export_batch_action

module Admin
  class SitesController < Admin::ApplicationController
    def export_batch_action
      Site.find(params[:batch_action_ids]).each(&:export)
      redirect_to :admin_sites, notice: "Successfully exported #{params[:batch_action_ids].size} sites"
    end
  end
end

And model with a Site#export method

class Site < ApplicationRecord
  def export
  end
end

Batch action not in admin on 0.3.4

When updating administrate_batch_actions from 0.3.1 to 0.3.4, the batch actions got renamed, for example, from merge_batch_action_admin_albums to merge_batch_action_albums. Somehow the admin namespace was lost?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.