I'm running rails 6 and activeadmin (2.8.0) with activeadmin-async_panel (0.2.5). Trying to follow the installation instructions but having problems.
I didn't have an active_admin.js.coffee in my project, so I created one inside app/assets/javascripts alongside the active_admin.js file that was already there:
app/assets/javascripts/active_admin.js.coffee:
#= require activeadmin-async_panel
app/assets/javascripts/active_admin.js has one line in it:
//= require active_admin/base
app/assets/stylesheets/active_admin.scss is this:
// Sass variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;
// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";
// Overriding any non-variable Sass must be done after the fact.
// For example, to change the default status-tag color:
//
// .status_tag { background: #6090DB; }
@import "activeadmin-async_panel";
In my AA page, I made a sample panel and member_action:
member_action :timecall do # /admin/animals/1/timecall
@count = Animal.count
render layout: false, locals: { count: @count }
end
panel 'Async test', class: 'async-panel', 'data-url' => '/admin/animals/1/timecall', 'data-period' => 1.second
Finally, my template is at app/views/admin/animals/timecall.html.erb:
embedded ruby file, animal name is <%= count %>
When I load the page, the panel appears, but the data-url is not accessed:
<div class="async-panel panel" data-url="/admin/animals/1/timecall" data-period="1">
<h3>Async test</h3>
<div class="panel_contents"></div>
</div>
Not sure what I'm doing wrong, as I followed the instructions in the README pretty closely.
I'm running rails 6 and activeadmin (2.8.0) with activeadmin-async_panel (0.2.5). Trying to follow the installation instructions but having problems.
I didn't have an active_admin.js.coffee in my project, so I created one inside app/assets/javascripts alongside the active_admin.js file that was already there:
app/assets/javascripts/active_admin.js.coffee:
#= require activeadmin-async_panelapp/assets/javascripts/active_admin.js has one line in it:
//= require active_admin/baseapp/assets/stylesheets/active_admin.scss is this:
In my AA page, I made a sample panel and member_action:
Finally, my template is at app/views/admin/animals/timecall.html.erb:
embedded ruby file, animal name is <%= count %>When I load the page, the panel appears, but the data-url is not accessed:
Not sure what I'm doing wrong, as I followed the instructions in the README pretty closely.