Guest User

Untitled

a guest
Feb 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ## code
  2.  
  3. <%= link_to_function "Show or Hide Nutritional Information", visual_effect(:toggle_blind, "nutritional_#{food.id}", :duration => 1) %>
  4. <div id="nutritional_<%=h food.id %>">
  5.  
  6.  
  7. ## result
  8.  
  9. <a href="#" onclick="Effect.toggle("nutritional_12",'blind',{duration:1});; return false;">Show or Hide Nutritional Information</a>
  10. <div id="nutritional_12">
  11.  
  12. ## source
  13.  
  14. complete guess but I'm thinking it might have something to do with
  15.  
  16. :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function}; return false;"
  17.  
  18.  
  19. that line of code from the api source. does #{function} escape the input thereby turning "nutritional_1" into "nutritional_1" ?
Add Comment
Please, Sign In to add comment