mercredi 25 janvier 2017

Render a layout on button click in rails

This is my drop down button

I am using Rails to render a layout depending on what user has selected from this dropdown menu and I have no idea how may I render a layout from within link_to

eg:
 #main_div
    show feeds from : 
        %button.dropbtn{'onclick':'myfunc()'}
            Dropdown
            %span.caret
        #myDropdown.dropdown-content
            =link_to 'public'
            =link_to 'followers'
    =render 'progress'

in this the way I am rendering progress statically I want to render it on button click something like this :

  =link_to 'public' , render: 'progress'

One more problem is that even if this works I want layout to be rendered in another div (main div as of snippet ) not in link_to's div as you can see in code

Aucun commentaire:

Enregistrer un commentaire