I am not sure what you are trying to do exactly but I think your whole
approach is probably wrong, it is certainly not conventional. I
suggest you work right through a good tutorial such as
railstutorial.org (which is free to use online) so that you will
understand the basics of rails.