hard link directories in osx and use dreamweaver with rails 13
I’m starting to use Netbeans and Dreamweaver for development of a new ruby on rails site I’m working on. Jruby for all the controllers and code, dreamweaver for design and templates. Netbeans is great for Jruby, it gives intellisense like autocomplete for ruby and easy navigation of your models and classes.
The design part wasn’t so easy. I’ve been using rails since v 0.65 or so, and have come to understand that when people can’t use a tool for a technology, they often say, the tools are for wimps. Don’t get me wrong, I’m all for good text editors, just not for graphic design. I can almost hear cave men saying that about the first farmers.
Dreamweaver and the Adobe tools are in my opinion the best tools for web design, and layout of pages. Sometimes, in the wrong hands the code they create is awful. It’s a tool, people misuse tools, get over it.
Dreamweaver doesn’t like rails. Dreamweaver expects sites to follow a certain pattern, Site root, Image directory, files which call the image directory are below the site root.
Rails doesn’t follow this pattern. It has an application root, with an {site-root}/app/views folder for the templates and all images/ stylesheets/ js in {site-root}/public.
As a result of this layout, dreamweaver will not show images / styles / proper links when designing templates for rails sites. In the past I got around this by creating, hack one off sites just for templates, then writing scripts to move all the code to the proper place in the rails app.
Today, I tried a different tack, Dreamweaver wont follow symlinks, it thinks they are a file. Hard linking in pre-leopard osx only works for individual files. But Leopard allows hard linking of directories, it just won’t expose this ability via bash, so a user will not be able to use this feature. OSX needs directory hard links for “time machine”.
Heres what I did.
I found some c code that overrides the osx features against hard links ( they can be bad and create infinite loops if you aren’t careful)
#include <unistd.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
if (argc != 3)
return 1;
int ret = link(argv[1], argv[2]);
if (ret != 0)
perror("link");
return ret;
}
save as hlink-dir.c
open terminal navigate to the location of the file and compile
enable root user - look up how to do that
gcc -o hlink-dir hlink-dir.c -Wall
chown root:wheel hlink-dir
chmod +x hlink-dir
mv hlink-dir /usr/local/bin
Now when you are logged in as root from terminal you type
hlink-dir Source-dir link-name
# you just created a hard linked directory
The Directories cannot be in the same folder, or the link won’t work.
Here’s the whole point of the story. From your rails {site-root}
cd {rails-site-root}
hlink-dir `pwd`/app/views `pwd`/public
open dreamweaver, create a new site and set the public directory to {site-root}/public. You are good to go. You can create the templates in dreamweaver, and the images from the site will actually show up in dreamweaver.
Thanks to Greg Miller for the hard link tip
Do you program with Django and Rails?
This seems like it might work for local development, but when you upload your project, won’t it just all break?
Beauty and the Beast” enjoying better-than-expected openings functional trainer
When logitech k750 wireless solar keyboard first introduced wireless peripherals, we’d be lucky if our alkaline cells lasted a week, but these days the firm’s low-power mice can go months on a charge. Now, the company’s taken the next logical step, and made a solar keyboard. With an ultra-slim 1/3-inch profile and a full slate of laptop-style chiclet keys, the Logitech Wireless Solar Keyboard K750 isn’t your average rack of buttons to begin with, but the ambient light solar panels installed on the top of either side should mean you’ll never need to plug it in to recharge.
Though we’re obviously far away from being able to tell you how the solar panels fare in normal use, we’re typing up this article on one of the boards right now. So far, we’re loving the flat, firm feel of the slab and rounded finger-friendly indents on each key, though the QWERTY layout’s actually a little cramped for our tastes. We’ll let you know how it holds up over the long haul. Find it next month for $80, though, if you’re already sold.
Though we’re obviously far away from being able to tell you how the solar panels fare in normal use, we’re typing up this article on one of the boards right now. So far, we’re loving the flat, firm feel of the slab and rounded finger-friendly indents on each key, though the QWERTY layout’s actually a little cramped for our tastes. We’ll let you know how it holds up over the long haul. Find it next month for $80, though, if you’re already sold.
I think it is better to use Django. I had really bad experiences with Rails
Balsum - Leather bags, Laptop bags, Luggage bags, Cheap Bags A professional and reliable online shopping center providing a variety of Fashion Bags at reasonable prices and shipping them globally
Cube U17GT Monster Phone Tablet PC 7 Inch Android 2.3 AFFS Screen 1GB RAM 8GB Dual Camera Gray
Thank you very much your article, in it for me is useful, by the way recommended newfreeshipping.com give you a surprise to you electronic products store
Thank you very much your article, in it for me is useful, by the way recommended newfreeshipping.com give you a surprise to you electronic products store
Netbeans is good for Jruby because it provides easy navigation of your models and classes and intellisense like autocomplete for ruby.
An eken t02 tablet pc is basically a little laptop. It’s all the essential functional options that come with an ordinary size laptop plus some which are unique.