by fadhli
on 18. Dec, 2008
in Rails
Something peculiar happened when I was doing something trivial. If you accidently named your restful route the following resource :roles instead of resources :roles When you point your app to /roles it won’t go to your index controller action but it will instead call your show action.
by fadhli
on 07. Dec, 2008
in git
I had a problem when running git svn command on my ubuntu. Can’t locate SVN/Core.pm in @INC It turns out all I had to do is install libsvn-perl.
by fadhli
on 20. Nov, 2008
in Rails
I had trouble reindexing the ferret index using the rake command (rake ferret:rebuild). I got this non-descriptive error regarding failing to rebuild it (Even in my development mode). So after googling for it, all one has to do is so simple. Go into your rails script/console and just type Model.rebuild_index And you’re done.
by fadhli
on 17. Aug, 2008
in web2.0
This is how people are upset about Twitter. http://iamrice.org/post/46208882/bullshit-hitler-twitters
by fadhli
on 22. Jul, 2008
in Programming, Rails
For example: id |category_id | inventory_id 1 384 1 #first entry 2 384 2 #this would be ok. 3 384 1 #this would not be ok To ensure that a category_id doesn’t have any inventory_id duplicate: [sourcecode language="ruby"] class CategoryProduct < ActiveRecord::Base belongs_to :category belongs_to :inventory validates_uniqueness_of :category_id, :scope => :inventory_id end [...]
by fadhli
on 15. Jul, 2008
in Rails
A good read on table index. http://www.railway.at/articles/2008/04/24/database-agnostic-database-ignorant Sometimes, it is easy to forget when someone or something else handles it for you. For instance, ActiveRecords. Rails does not create foreign keys for you. It only creates the primary key. It does not impose constraint on the database level. The association is handled on the application [...]
by fadhli
on 14. Jul, 2008
in Programming, Rails
Do not name your database column with the name ‘no’. You’ll get this error when you try to run your test ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ‘false’ in ‘field list’
by fadhli
on 03. Jul, 2008
in git
If you’re someone who has multiple git branches on a project and seem to always do git branch to check which branch you’re in. Then here’s how you can make your bash aware of a git branch. Well, I’m not sure if this works on others, but it sure does works in my Ubuntu Hardy. [...]
by fadhli
on 02. Jul, 2008
in git
The beauty of git is there is no one true way to do it. Here’s how the Rails Frameworks maintainers uses git. http://rails.lighthouseapp.com/projects/8994/sending-patches And here’s a wonderful video from Railscast on how to contribute to Rails. http://railscasts.com/episodes/113
by fadhli
on 02. Jul, 2008
in git
So , after doing a little bit of homework, this is how I’m gonna do it. I’ll try the forking approach. Assuming that the repo is forked from a repo in github.Taken from Dr Nic’s website http://drnicwilliams.com/2008/02/03/using-git-within-a-team/ Forking is to clone an entire remote repository into another remote repository. Now you have two repositories based [...]