Alberto Negron

Joined

90 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Payment Rails Master Class (SCA) ready?

thanks! looking forward to it

Posted in Payment Rails Master Class (SCA) ready?

Hi Chris,

I am wondering if Payments with Ruby on Rails Master Class is up-to-date with Stripe Strong Customer Authentication (SCA)?

Thanks

Alberto

sorted with smart_aggs: false

Hi everyone,

Great video, I've seen it a few times now as I have the following problem:

Every time I click on any value, it filters out the main table and the sidebar at the same time so the <strong></strong> is a bit helpless at the moment.

any ideas?

here is my controller:

  def index
    query = params[:q].presence || "*"
    args = {status: true}
    args["cat_name"] = params[:cat_name] if params[:cat_name]
    @products = Product.search(query, where: args,  aggs: {cat_name: {order: {"_key" => "asc"}}}, includes: [:supplier, :category])
  end

and partial view:

    <h4>Compra por Especialidad</h4>
         <ul class="list-group">
         <% @products.aggs["cat_name"]["buckets"].each do |bucket| %>
            <%if params[:cat_name] == bucket["key"] %>
              <strong>
               <%= link_to "#{bucket["key"].capitalize}<span class='badge badge-primary badge-pill'>#{bucket["doc_count"]}</span>".html_safe, request.params.merge(cat_name: bucket["key"]), class:"list-group-item  list-group-item-action d-flex justify-content-between align-items-center"%>
              </strong>
            <% else %>
               <%= link_to "#{bucket["key"].capitalize}<span class='badge badge-primary badge-pill'>#{bucket["doc_count"]}</span>".html_safe, request.params.merge(cat_name: bucket["key"]), class:"list-group-item  list-group-item-action d-flex justify-content-between align-items-center"%>
            <%end%>

      <% end %>

thanks

Hi,

I am late to the party - the way I managed to display description rather than ID is by modifying search_data method like this:

def search_data
    {
      name: name,
      description: description,
      sup_name: supplier.name,
      cat_name: category.name,
      status: active
    }

I can use cat_name in my aggs.

Hope it helps.