var modal = "<%=j render 'photo_link' %>"; $(modal).modal();