• Advertisement
Sign in to follow this  
  • entries
    59
  • comments
    114
  • views
    22630

Ruby on Rails

Sign in to follow this  

35 views

Quote:
Every time I see the name "Ruby on Rails" it reminds me of this coke-whore who lived in my college dorm...


I have been messing around w/ Rails again. Never a good thing, but I've got a conherent project in mind with a very simple feature set. Basically looking to make an effective inventory management system for small businesses. Something that I have not currently planned through on the system is users and ACLs, as this is something I'd like to solve in a manner that it can be either interfaced to a centeral user system that future projects I make can be interfaced too.

Anyways, I have been working on my db schema. The basics are in place, each object to be tracked has a location, owner, and identifing information. Each location has an address. A location can be moved and mapped to a new address, such that location "Washu's Secret Lab" and all objects that are in that location, can be easily moved to a new address when Washu opens a new door down the lane. Conversly, multiple locations can point to the same address id, and that address can be updated, having wider effecting changes. Of course for instances where more then one location is being effected by a changed address I plan to notify the user of that fact, and provide easy access to splitting the locations into two or more groups pointing to specific addresses. Each object, also has a model, which in turn has a make. Each model also has a category (another user definable list for things such as hardware/software/soft serve ice cream/misplaced tentacles) as such making reporting easy, to pull together a complete inventory report based on category, make and model etc.

I'm also planning to include a method to link objects to external repositiores of knowledge like wikis, such that additional notes can be applied, like linking to resources and documentation (101 ways to clean your tentacles).

Rails makes this all damn easy, I don't have to touch a line of SQL to establish this beautiful and complex relational database. Even provides convient database server abstract migration scripting.
class CreateLocations < ActiveRecord::Migration
def self.up
create_table :locations do |t|
# t.column :name, :string
t.column :address_id, :int
t.column :name, :string
t.column :noteurl, :string
end
end

def self.down
drop_table :locations
end
end




Also, with Capistrano I can type "rake deploy" to execute a complete deployment from my win32 command line to my remote server box, including database migration, and managing the Mongrel sessions.


On the backend I have Apache 2.0 mod_proxy forwarding to a Mongrel cluster, which in turns serves up the dynamic content. Best of all, this solution is scalable to the moon should it need to be. To add more capacity, we end up w/ multiple Mongrel clusters, forwarded too by multiple Apache servers, all backed by a clustered databse. You can read about this configuration Here and a few other places by now. The great thing is that Mongrel is "fast", ruby is still slow, and there is yet to be a compiled bytecode formate for ruby, but this configuration is production deployable for most people. While not "enterprise", you can survive a fark/slashdot/digg/etc flood.

I'll post a link once I have a more complete application running on my server, but as it stands right now, the only thing that is mostly complete is the schema, alot of work now has to go into providing a simple and consistent user interface to accomplishing their "scenario/workflow/throwing floor caek at Promit".


Side note,
I have given up on a COM tutorial. I just can't consider myself qualified on the that subject, nor do I have sufficent resources to tap to teach myself and then teach you poppets. So I have to ask forgiveness. I may attempt to revisit it in the future. Especially with the concept of calling COM+ directly from ruby. (god knows the abmoninations I could pull with rails and dcom)
Sign in to follow this  


2 Comments


Recommended Comments

I just started with rails about 3 months ago. I don't know how I lived without it...

The first time I used "belongs_to_and_has_many" and had it just...work...I was floored. What a great tool.

Share this comment


Link to comment
I have to get into ASP.net still, to round out my expereince, but Rails is fun to work in, unlike J2EE which is painful. Rails is just a web framework, which makes the whole MVC abstraction somewhat pointless currently until someone makes view mapping system for seperate systems. I guess that ends up being the beauty of Camping, it takes something concise already, and makes it more concise by removing MVC from the setup.

That is one thing I'd like to change or see changed about rails, a view system for bringing in multiple client types, to connnect to the same controllers etc. Not just assumed HTML.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement