Friday, January 06, 2006

RoR 101

for a very simple app without a database here is how to start..
  1. name your controller say word
  2. in config/routes.rb map.index '', :controller => "word"
  3. in app/controllers create a new file called word_controller.rb and put a ruby class called WordController.
  4. in app/views createa folder called word.
  5. in app/views/word create a file called index.rhtml
  6. in rename public/index.rhtml to old-index.rhtml
thats enough to get started . and have a lot of fun

now run script/server
even if it complains that it cannot connect to a database just proceed and start it [ this happens if you are using radrails, and i suggest you use radrails ]

now if you point your browser to http://127.0.0.1:3000/ and press enter
you will see that what ever you put in the file app/views/word/index.rhtml is rendered :)

Tuesday, January 03, 2006

A Rosy Picture

have you ever played the game "petals of the rose" ?
my first run in with rails was like a bigger version of that game,
it took me a wile to figure out what was actually happening.
but once i did get my head around it, i started liking rails little by little.

yesterday i spent about 50 odd minutes to create a site, and that includes discussion with the client/partner !!

however, i still think i need another month or so, to trudge thru the API before i feel comfortable enough. yesterday i was telling some one that if i could do this site in perl or java servlets/jsp.. i could have finished it pretty fast.. today i realise that that thought was what was holding me back.

i was constatnly trying to think in terms of the reqest and response .. when i last dabled in website development, i used to parse each request and construct a response. well now you just put your resoonse in a place, and it gets picked up. so all you have to know is what to name stuff..

in my next post i will write a short summary that should help any one get uptospeed with rails.
cheers
ram

Sunday, January 01, 2006

ground zero

hi all,
in this blog i will write mynotes about rails as i go ahead, i hope to engage in some discussion thru hte comments or on irc://irc.freenode.net/#rubyonrails .

please note that i dont have any particular affinity or adversity towards any tool kit/framework . so kindly no flames please. im just trying to learn to make web apps, to bring my ideas and those of others who ask me ot make a webapp for them to implementation . i really dotn care what tool or language is underneath. right now im toying with rubyonrails.i played around for a day with django
so my irc handle is new2django , i dont want to change it, for whatever reason. so when i say something comparing the both, kindly dont asusme that im one side or the other. im on neither!!

to start with, ill give a small note on my first observations in the next post.
if you want me to do post on any topic of interest or use to you, by all means plese do ask me either on irc or in teh commetns section of this blog.
thanks cheers
ram