Posts

ruby on rails - What value should I pass to paperclip to make it so that the file does not update? -

when update file in app, deletes , re-saves paperclip file. wan't pass in update_attributes allows paperclip ignore it, not delete current file. pass in? i passing in file, deletes , resaves. you might using class user < activerecord::base has_attached_file :attachment, :url => :attachment_url, :path => :attachment_path, :default_url => "/images/sheet.png" end try adding :preserve_files => false . way when add new file previous file reserved , not deleted. final result class user < activerecord::base has_attached_file :attachment, :preserve_files => false, :url => :attachment_url, :path => :attachment_path, :default_url => "/images/sheet.png" end check http://www.codesapling.com/blog/2014/01/10/saving-all-uploaded-attachments-with-paperclip/

php - tag friends 2 jquery multiple tagFormat -

i using jquery - tag friend 2 plugin auto-complete action. working fine strings starting @, have use same logic tagformat # same field. result should tracj both @ , # symbols , curresponding ajax urls different. here deafault way of callinf plugin $(function() { $('#post').tagfriends2({ url: 'userlist.php', debug: false, placeholder: '', onupdate: function(data) { $('#count').text(data.count); }, suggclass: 'suggetions', sugtpl: '<li><a data-val="{id}" href=""><table><tr><td><img src="{profile_image}"></td><td>{profile_name}</td></tr></table></a></li>' }); }); this track @ symbols , giving auto-complete facebook. want autocomplete option # symbols. purpose: @symbols used tagging users , # symbol brands. how can this? currently can...

java - How to use Ajax with select option tags in Jsp page ? -

in jsp page , have 2 different select option tags menĂ¼ . fill first 1 list mysql database. when select 1 value list ,i want fill second select tag list sended mysql . , in ajax , when send list servlet jsp , how fill second select option menu list in jsp page ? use javascript library jquery (that known , used/tested) http://api.jquery.com/jquery.ajax/

asp.net mvc - W3C Validation Not working for RazorView -

i using mvc4 project , doing url rewrite on server side in routeconfig , appending .html @ end of url of every page.. www.mysite.com/home.html i have couple of pages , pages linked home page (every think working find in browser). but when validate using w3c link checker, broken link error message. i don't know can issue. 1 more thing if replace .html .aspx or other extension validated w3c. don't know issue. my code is: routes.maproute( name: "features", url: "features.html", defaults: new { controller = "home", action = "features", page = urlparameter.optional } ); web.config : <add name="htmlfilehandler" path="*.html" verb="get" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0" /> any highly appreciated ok solved this. i r...

javascript - How can I use jquery events on a list of ids? -

i have html list of ids like: <div id="id0" value="myval0">click me</div> <div id="id1" value="myval1">click me</div> <div id="id2" value="myval2">click me</div> <div id="id3" value="myval3">click me</div> the list can generated server. trying jquery of form send server id has been clicked: $( "#id0" ).click(function() { var urlstring = '/getresult'; alert($("#id0").val()); $.ajax({ type: "post", url: urlstring, data: { draft_no: $("#id0").val(), }, success: function(result){ alert("function returned success!") } }); }); in case have sent id of form "id0". how can generalise "id n" n integer? try jquery selector e[a^=v] match elements e possess attribute a value starts width v your html: <div id="id-1"...

c# - NEST - Index individual fields -

i'm transitioning elasticsearch on website , using nest c# .net interface. in writing code index content, can't figure out how map fields individually. suppose have following: var person = new person { id = "1", firstname = "martijn", lastname = "laarman", email = "martijn@gmail.com", posts = "50", yearsofexperience = "26" }; rather indexing entire dataset using: var index = client.index(person); i want index firstname , lastname can searched upon, don't need other fields in index (other id) because take space. can me code map these fields individually? you should add mapping when create index initially. 1 way can using nest attributes on class this: public class person { public string id { get; set; } public string firstname { get; set; } public string lastname { get; set; } [elasticproperty(store=false, index=fieldindexoption.not_analyzed)] ...

user interface - UI Windows 8 Look in JAVA -

im creating system standalone , not online. java based system. want make ui in windows 8. possible? using java fx , css can mimic windows 8 metro interface. see here : http://code.makery.ch/java/javafx-2-tutorial-part4 or here : http://pixelduke.wordpress.com/