Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rendering twitter bootstrap modal in rails upon redirect

I have a functioning modal link that is clickable from a certain page in my views:

<a href="#" data-toggle="modal" data-target="#manifesto-modal">Manifesto &amp; Rules</a>

In addition to it being clickable on this page, I would like it to be displayed by default upon redirect to this page. I haven't found a great approach to coding this from the controller or otherwise, but can't imagine it would require too much. Input is appreciated!

like image 881
keypulsations Avatar asked Dec 27 '22 15:12

keypulsations


1 Answers

according to the docs, you could use the flash (untested):

redirect_to your_path, flash: { manifesto_modal: true }

then in your view :

<% if flash[:manifesto_modal] %>
  // a script to display modal on document ready
<% end %>
like image 66
m_x Avatar answered Dec 29 '22 11:12

m_x