javascript - Rails4 + Bootstrap3 - Modals render but won't show -
i'm using rails 4, bootstrap 3. particular page in question made of 3 haml views. first contains of page content. second contains row of buttons - 1 of needs trigger modal. third contains modal.
code first view is:
<...bulk of page content...> = render partial: 'shared/buttons', locals: {diagram: @diagram} #showdetail.modal.fade{"aria-labelledby" => "showdetail", :role => dialog, :tabindex => "-1"}
code second view ('shared/buttons'):
<...links several buttons don't call modals...> = link_to "show detail", show_detail_path(item), class: "btn", data: {"toggle" => "modal", "target" => "#showdetail", "remote" => :true}
code third view (items/_show_detail.html.haml, routed 'show_detail_path'):
.modal-dialog{:role => "document} .my_popup_contain .container-fluid <...rest of code page...>
and in controller:
def show_detail render partial: "show_detail" end
so setup, clicking button produces page "fade" modal going appear, never does. clicking again (anywhere) makes page fade go away (just if modal displayed). rails server logs show modal render:
started "/items/4/show_detail" 127.0.0.1 @ 2016-02-22 14:49:44 -0600 processing itemscontroller#show_detail js parameters: {"id"=>"4"} user load (2.1ms) select "users".* "users" "users"."id" = 1 order "users"."id" asc limit 1 item load (1.5ms) select "items".* "items" "items"."type" in ('item') , "items"."id" = $1 limit 1 [["id", 4]] rendered items/_show_detail.html.haml (1.1ms) completed 200 ok in 11ms (views: 4.7ms | activerecord: 3.6ms)
what missing? calls between views correct?
fixed adding code first view:
<...bulk of page content...> = render partial: 'shared/buttons', locals: {diagram: @diagram} #showdetail.modal.fade{"aria-labelledby" => "showdetail", :role => dialog, :tabindex => "-1"} = render partial 'items/show_detail'
that calls modal , works expected.
Comments
Post a Comment