I was having some trouble trying to render a collection. I was trying to use the shorthand notation by just doing this.
<%= render "image", :collection => @item.images %>
For some reason it wasn’t passing an item to the image object inside the _image template. Not sure why this didn’t work but to solve it I did:
<%= render :partial => 'image', :collection => @item.images %>
and it worked exactly how I expected it. It might have been specified in the documentation, but wasn’t visible enough for me to notice it at a quick glance. This types of small problems will get taken care of eventually.
Sorry I haven’t posted anything in a long time. I have been super busy with school, work, projects, and life. Something had to slip and it was posting on the blog. Well I will be adding new posts about once a week on stuff that I am interested in and/or hacking on.
A little project that clones a feature on Finder that is missing on linux, command-shift-g.
I found this guide today while looking for using virtualenv and pip together. I figured that other people would like this guide so I am going to post a link here The Hitchhiker’s Guide to Packaging
So I got pip installed and wanting to install all my packages in my home directory. Pep-0370 already has this covered and pip as of 0.8 uses that interface.
To install a package to your home directory you do pip --install-option=--user MyPackage and this will install into a path that will be accessible by python. I didn’t want to have to type --install-option=--user every time I want to install with pip. This is the solution that I found to work.
Pip has a configuration file in .pip/pip.conf under Unix type distros (Mac included). So I created the new folder and file and inside of it I put:
[install]
install-option =--user
Close the file and I tested it by doing a pip install django and it worked. Yay one more thing that gem doesn’t have on pip.
I always run into the problem where I am doing a functional test and I keep wondering why my results are not working out as they should be.
They always end up being resolved by putting in a .reload after I put in my instance variable.
So Sifi, remember to put .reload after your instance variables.
Post with 1 note
This one I must have skipped
:E
Woah, I used to use :e. all the time but this really saves me the trouble of going through the trouble of moving to the current directory.
:E is short for :Explore
We recently switched from running hoptoad_notifier as a vendor/plugin to a gem and encountered a small error.
First it was quite an easy conversion. We installed the gem as usual, then we changed config/envirnoment.rb to add config.gem 'hoptoad_notifier'. Then everything worked as expected. The problem is when we don’t have the gem installed and try to run rake gems:install on a fresh machine. You will constantly get
no such file to load -- hoptoad_notifier/tasks
This wasn’t very hard to debug. I just went into lib/tasks/hoptoad_notifier_tasks.rake and changed it like so:
-require 'hoptoad_notifier/tasks'
+begin
+ require 'hoptoad_notifier/tasks'
+rescue LoadError
+end
Now rake will end up working and you can then do a rake gems:install on a fresh machine to get all your gems working.
Took me a while to figure this out. I was trying to use --staged but that wasn’t working and I didn’t really feel like reading the help page because you can’t grep though them. But I finally figured it out:
git diff --cached
So i released a QT based editor on github. It is rather simple and doesn’t have a name yet.
.plan
get fakevim working in it.
Settings manager
Page 1 of 3