Guest User

Untitled

a guest
May 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. HELPER:
  2. module StarHelper
  3. def format_cell(val)
  4. case val
  5. when "n/a"
  6. cell = "n/a"
  7. when nil
  8. cell = "?"
  9. else
  10. cell = %{ link_to "yes", #{val} }
  11. end
  12. end
  13. end
  14.  
  15. VIEW:
  16. <td style="text-align:center;"><%= format_cell line.base_file %></td>
  17.  
  18. output:
  19. table cell contains link_to "yes", data_101202.xls rather than the HTML for linking yes to the filename. in other words, the string from the helper is being printed rather than the HTML rendered.
Add Comment
Please, Sign In to add comment