Greetings, I enjoyed your video on Chartkick, it's very informative. What I would like your advice on, is how do I use Chartkick alongside the Impressionist gem. To be more clear. I would like to graph the impressions of different pages. Lets say for example, the user show page. I would like to get the
<%= line_chart current_user.impressionist_count, refresh: 60, xtitle: 'Monthly Profile View Count', ytitle: 'Amount of Views' %>
This approach isn't working for me. I need to be able to get the impressions count with scopes for days, weeks and months and years. I'm currently using Postgres. I've been searching for an approach all day long, to no avail. If I'm able to use the scopes across model types like Product show page, etc. That would be great. Thanks again!
Impressionist documentation
https://github.com/charlotte-ruby/impressionist
The group_by_day & and group_by_month, methods are not being found for some reason. It throws an undefined method error for model, when I try to use the it in my view. I don't know if its an issue with the gem or Postgres compatibility.
Thanks.
Your method is working perfectly in the rails console. I will test in the view today. Thanks.
reset_form_controller.js import {Controller} from 'stimulus' export default class extends Controller { static targets = ["button"] reset() { this.element.reset() this.buttonTarget.disabled = false } }
new.html.erb <%= turbo_frame_tag "new_conversation_conversation_comment", target: "_top" do %> <%= form_with(model: [@conversation_comment.conversation, @conversation_comment], html: {class: 'form-inline'}, data: {controller: "reset_form", action: "turbo:submit-end->reset_form#reset"}) do |form| %> <div class="mt-1"> <%= button_tag(type: :submit, class: 'btn btn-primary btn-sm', style: 'float: right; height: 36px !important; border-radius: 0px !important;') do %> Send <% end %> </div> <div style="overflow: hidden;"> <%= form.text_field :content, placeholder: 'Type your message....', style: 'width: 100% !important; border-radius: 0 !important;' %> </div> <% end %> <script> $(document).ready(function () { $("#conversation_comment_content").emojioneArea({ pickerPosition: "top", filtersPosition: "bottom", tones: false, autocomplete: false, inline: true, hidePickerOnBlur: false }); }); </script> <% end %> conversation - show action. <div class="col-6"> <% if @conversation.present? %> <%= turbo_stream_from @conversation %> <div class="chat-room"> <%= turbo_frame_tag "conversation" do %> <div class="text-center chat-room-title"> <h5 class="text-light-charcoal"><%= @conversation.title %></h5> </div> <% end %> <div id="conversation_comments"> <%= render @conversation.conversation_comments %> </div> <div class="chat-box"> <%= turbo_frame_tag 'new_conversation_conversation_comment', src: new_conversation_conversation_comment_path(@conversation), target: "_top" %> </div> </div> <% end %> </div>