<%= content_for :javascript do %> var title = "<%=escape_javascript(t('search.attachments.dots'))%>" $("#query").click(function(){ if(this.value == title){ this.value=""; } }); $("#query").blur(function(){ if(this.value == ""){ this.value= title; } }); <%end%> <%= form_tag(@space.nil? ? search_attachments_path : space_search_attachments_path(@space), :method => 'get') do %> <%= text_field_tag 'query',(params[:query] ? params[:query] : t('search.attachments.dots'))%> <% end %>