vendredi 13 avril 2018

Use Ajax with Ruby to load a Partial within a div

I have the following drop-down menu (screenshot below). What I want to do is to click on each subcategory and show a partial with the information on the gray space below the menu. The menu uses HAML with the following code (excerpt below). Basically, I need to pass a value to the :href attribute and then show the according to partial into the div.

      %li
        %a.dropdown-button.dropdown-menu-kpis{"data-activates" => "SalesDropDown", :href => "#!"}
          %i.material-icons attach_money
          %span
            Sales
            %i.material-icons.right keyboard_arrow_down
        %ul#SalesDropDown.dropdown-content.dropdown-horizontal-list
          %li
            %a.dropdown-content-items{:href => "#general_kpis_sales_aggregate"} Agreggate

Categories Menu and Space to show results

Aucun commentaire:

Enregistrer un commentaire