I’ll be ready to release my first rails application into the world by the end of the weekend, it’s actually a live site, that will have real content, though it’s only using a portion of MicroCMS, which is still being slowly updated. Hopefully I can get a commit in with the basics this weekend as well.
In any case, file uploading using rails has been a very unique experience, searching around the web, it seems people are very fond of using plugins for this, while that’s all fine and well, I don’t like relying on external plugins too terribly much, I also think it hinders learning, so I’m avoiding it.
The specs for the file upload I had were:
- - has_many relationship to each product
- - thumbnails created (still evaluating which ruby magik library I will be using, leaning towards RMagick)
- - physical file storage, reference in the database
- - complete CMS image management, this should be easy
Hopefully before Monday I will post information on this and also using Authlogic and adding a simple admin role.
Also note, take my examples with a grain of salt, because there are always better solutions available, what I post here is mostly for my own documentation and personal learning, and is not to be thought of as any sort of golden standard, I’m horrible with code, that’s the point of writing about it.
Happy fourth of July!
I ended up buying a new 13″ MacBook Pro to do my development work on. Windows can work just fine, and I had a decent environment setup for it, but I just don’t feel as much at ease on windows, as I do with a *nix terminal and TextMate.
So, as a result, MicroCMS is in the first actual stages of a functional system, currently implemented features: Authentication with AuthLogic, Authorization for roles (Guest(Implied), User, Admin). Pages can be added and deleted, as well as users.
There is still a lot of work to be done, but for now I’ve put the semi working copy on github, and I will get documentation going shortly so it’s kept up to date.
I have plans to write a tutorial on how I setup basic authorization with AuthLogic since everyone tends to use plugins with Rails. I’d say if anything, that is my main gripe about working with rails, everyone uses a plugin for everything. While that’s probably just fine, something like the very basic authorization I needed really didn’t call for heavy role based authorization, and even so, it’s not terribly hard or time consuming to roll your own.
The very reason I chose AuthLogic is that Ben Johnson has done an amazing job with the code, after looking through the source and using AuthLogic, it’s really stripped down so I can be pretty sure there isn’t a lot of excess bloat.
To view and critique my code, you can find it by going here: http://github.com/thismat/MicroCMS/tree/master
Time to get back to documentation and planning the comments for pages feature.