Conditional RJS


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. page << "if($('some_div').visible()){"
  2. page['some_div'].replace :partial => 'some_partial'
  3. page << '}else{'
  4. page.insert_html :after, 'something_else', :partial => 'header'
  5. page << '}'
  6.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.