Looking for a good Rails blog app?
Yeah, me too. This blog is typo, but to be honest, I’m not a big fan.
Here’s the problem.. I don’t really want a “rails application” at all - what I want is to be able to add blog features to my current applications.
With the need for mongrels et all, what I really think we need is either:
1) An application that you can point multiple domains to, e.g. blog.domain1.com, blog.domain2.com etc. that can be a single install / application with a single environment that is multi-purpose.
2) A blog plugin, that works off a single controller for admin, and a single controller for view that can be thrown into any rails application.
I’ve been working on 2, and it’s turning out pretty well, but at this point it’s too application specific to throw out to the open source community. The focus is on simple simple simple and seo seo seo.
What started off as a standalone project, has now been integrated into Billabill here.
Features include:
- SEO: Independent control of stub, title, H1 and tags
- SEO: Blog title displayed as H1 or H2 depending on context
- SEO: Blog summary used as full article teaser reused as meta description
- Full page caching with a very simple cache clearing mechanism
- Routing setup so that categories become root directory for posting
- Category stored with a post - no separate table. There’s really no need
It can do more than you can see at Billabill, but I’m not using everything, e.g. the ability for any post to be tagged as a header, footer or sidebar menu item.. Again, features on the front without any extra complexity.
What it would need to be great though is:
- Simple THREADED comments with subscription.. why are blog comments linear!
- RSS - 10 minute job, but I haven’t done it yet
- A parsing engine to allow you to easily include links to other internal pages
- A parsing engine to include flickr content etc.
Anyhoo. If I get a chance I’ll try to bundle this up and turn it into a plugin because I really think that is the answer.. just like you can add a WordPress blog to any php site, you should be able to add a rails blog alongside any rails app.
How to customize the Gemini gedit plugin
gedit is Textmate for Linux
I’m a recent convert to gedit for my rails development after reading a digg article about how to make gedit act like Textmate. Well I’ve never used textmate, but after just a short spell of using some textmate like features, I’m sold too.
Gemini
One of the two plugins that I’ve grown to love is Gemini by Gary Haran for the auto-insertion of closing tags.
I like it, but it also drove me nuts in it’s default form, in that it auto completes the single apostrophy - fine in code, but if you are jumping back and forth between code and text creation then this is really annoying. Words like “doesn’t”, “hasn’t”, “don’t” etc. all kick off the closing quote - not ideal.
Removing and adding rules to Gemini
The beauty of Open Source is you can change it. If I knew Python, what I should really be doing is contributing with a “configuration” screen for Gemini, but I don’t - so I’ll just hack it.
To remove the single quote rule, open the file:
/.gnome2/gedit/plugins/gemini.py
and search for
“class Gemini:”
start_keyvals = [34, 39, 96, 40, 91, 123, 60]
end_keyvals = [34, 39, 96, 41, 93, 125, 62]
twin_start = ['"', "'", '`', '(', '[', '{', '<']
twin_end = ['"', "'", '`', ')', ']', '}', '>']
and change to:
start_keyvals = [34, 96, 40, 91, 123, 60]
end_keyvals = [34, 96, 41, 93, 125, 62]
twin_start = ['"', '`', '(', '[', '{', '<']
twin_end = ['"', '`', ')', ']', '}', '>']
Restart gedit and you are good to go!
Adding rules, eg. % for Rails
Adding is pretty much the same process. In Rails views, you often use:
<% content %>
so it would be great if Gemini had a rule for % and that’s really simple. Looking again at this block of 4 lines of code, what we have is 2 lines that state ASCII values, and 2 lines that show the character.
By modifying and adding % and it’s ascii value 37, we end up with:
start_keyvals = [34, 96, 40, 91, 123, 60, 37]
end_keyvals = [34, 96, 41, 93, 125, 62, 37]
twin_start = ['"', '`', '(', '[', '{', '<', '%']
twin_end = ['"', '`', ')', ']', '}', '>', '%']
Restart gedit, and typing “<%” in a view now kicks off the <> and %% rules - awesome.
Essential Ruby on Rails tools for the Ubuntu User
Window’s doesn’t cut it
Ruby on Rails was the straw that broke the camels back for me, and motivated me to switch to Linux on my desktops and laptop. Since then, I’ve tried various tools, but here are a couple of things I wouldn’t like to try to do without.
Editor - Bluefish
Quanta is a close runner up but I find Bluefish to be “the one”.
Why? Well for me an absolutely ESSENTIAL need in a rails editor is a really good directory and file tree in the left nav. It’s great that rails has a place for everything, but let’s face it, rails applications also have lots of files. If I had to click Open and navigate to a file I’d shoot myself.
Bluefish sidebar does a great job of:
- 1) Finding your rails app
- 2) Making it the base directory of the tree
- 3) Allowing you to expand trees as needed
Personally, I find the visibility of files so good that as a general rule, if I can’t see all of the open file tabs without scrolling left or right, I close all files and start again.
Syntax highlighting is great, although you’ll have to add .erb as a ruby extension through the setup.
Feature wish: Multiple rows of open tabs would be nice, but then I’d just get into bad habits again.
MySQL tool - Navicat
I’m a command line kinda guy.. I’ll use a terminal to move files before I drag and drop, but for some reason I’ve never got hooked on command line sql. That’s possibly because in the early days, I found Navicat.
I know that phpmyadmin is somewhat of an industry standard, but personally I hate it! Navicat is a locally installed application, available for Windows, Mac and yes, Linux that for me blows the socks off anything else I’ve tried.
As it’s not running on the host, then there is of course the inconvenience of having to configurating mysql to allow your IP, but it’s worth it. I use both the Linux version, and the Windows version running under wine. Pretty much the same, except I have a Windows license, so that unlocks some extra goodies. I use navicat for:
- Adding sample data
- Fixing data ( not structures of course ) during development
- Administration on live sites ( e.g. flagging that someone has made a donation at Listingly.com )
- Browsing and generally perusing during development
- Backups! One click and you have a local backup of your remote application
Give it a go. 30 day free trial.
Quake style Terminal - Yakuake
Yakuake is a terminal that reveals and hides itself with the F12 key. For some reason, I just like using it for running my development server process in. It’s no different from a terminal window, but it just feels good to me to have it tucked away there.
SSHFS
Yikes, I’m going to reveal my bad habits now.. in that I don’t SVN and I don’t capistrano. I’m a bad person. It’s on the to do list now as I need to work along side my buddy benr75 on some projects, so no doubt I’ll take what he indoctrinates me with and apply it to my own stuff too.
Until then though, SSHFS is the ultimate. SSHFS is a way to mount remote folders as local folders across SSH. In other words, if you have SSH access to your server, you can mount it locally!
My personal setup is that I develop in:
/home/[user]/www/rails_app
and remote mount:
/home/[user]/rrr/rails_app
as the equivilent application on the remote server. I then have a couple of scripts:
getcore [railsapp] and sendcore [railsapp]
which either fetch or send:
/public /app /db
Of course after that I still have to manually run migrations, and restart mongrel processes but for a single developer environment I bet from a purely time efficiency perspective this effort is significantly less than the effort of using SVN.
As an aside, I always use SSHFS all the time when I realize that I have a file at home that I need at work and visa versa.. just open up an obscure port on your firewall and map it to 23 on your machine and you can mount the remote machine as a local folder.
Genius ;-)
XaraLX - In my mind the ultimate grahic design tool
Worthy of a mention as my rails projects would not be what they are without XaraLX. It’s really nothing to do with Rails, but for years and years this has been my tool of choice ( over Photoshop and Illustrator ) for design and implimentation. I cried for joy when I saw that they had an open source project!
Apache & Mongrel Play Nice
You know the way you set something up once in a while ( when you are not using Microsoft products ) and think to yourself, “That’s Nice”.
Mongrel and Apache working together just gave me that joy.. So simple, especially in single instance Mongrel setup.
Basically:
1) Start Mongrel
cd /rails_app/ mongrel_rails start -d -p 3000 ( where 3000 is an available port)
2) Check Mongrel http://that_domain.com:3000
3) Tell Apache Create a virtual_host entry for the site in question and add:
ProxyPass / http://127.0.0.1:3000/ ProxyPassReverse / http://127.0.0.1:3000
Older posts: 1 2



