How show hide image in paperclip when no image present
I use the following to find wether a model has an associated attachment: <% if @agent.avatar.file? %> <%= image_tag @agent.avatar.url(:normal) %> <% else %> No attachment available! <% end %>
I use the following to find wether a model has an associated attachment: <% if @agent.avatar.file? %> <%= image_tag @agent.avatar.url(:normal) %> <% else %> No attachment available! <% end %>
You can do this if you use a plugin manager like Vundle or Pathogen, which will keep the plugin in its own directory underneath the ~/.vim/bundle/ directory. In that case, just find out the runtimepath of the vimacs plugin with the following command: set runtimepath? Let’s say it’s ~/.vim/bundle/vimacs. Then, put this command in your … Read more
I’ve done it at http://reinout.vanrees.org/weblog. The key trick is to add a preprocessor step. I’ve got my blog entries in a weblog/yyyy/mm/dd/ folder structure. A script iterates through that folder structure, creating index.txt files in every directory, listing the sub-items. The normal Sphinx process then renders those index.txt files. I added a custom Sphinx processor … Read more
Since you are trying to call this function on the resize of the window, you will want to bind the function to the window and not to the document. To support versions of IE that are less than 9, you will want to use attachEvent. Please note that attachEvent requires you to specify the on … Read more
See here :id => @document @document is the variable that contains nil however this should contain some id (like 1,2 or whatever) of required record check it in your controller and once you will fix this issue sure this error will be resolved.
Update 2013-08-20 Adam Driscoll has recently announced the PowerShell Tools for Visual Studio as successor of his former PowerGUI Visual Studio Extension – see his blog post about The Future of PowerGUI VSX for details, where he acknowledges the drawbacks of the predecessor outlined by Simon Gillbee (see previous update below) and describes how they … Read more
How about: Save your Word docs in XML. Commit your XML Word files. Diff using an external XML diff tool. For example: $ git difftool -t xmldiff c3d293 498571 Transforming the XML files to have one element per line should make the check-in process run efficiently and also allow the external XML diff tool to … Read more
I’m not sure about the active plugin on a file part, but you can quickly go in and remove plugins that are installed by opening the Command Pallete (Cmd-Shift-P on Mac) and typing remove if you have Package Control installed. You will see Package Control: Remove Package** Once the list of installed plugins shows up … Read more
apply plugin: ‘android’ specifies that It’s an Android project but it does not specify Its an Application or Library project. To make life easier you can tell gradle the type of project and indicate which plugin should be used. I recommend to use apply plugin: ‘com.android.application’ if project is an app and apply plugin: ‘com.android.library’ … Read more