To understand the flow of application in ror


#1

hi every one i am new in this platform and seeking for help . i have
created a small application which runs quite well but actually i dont
know how it flows when and where the method calls itself.

i know every request handeled by controller ,i have read agile web
development and started to build a shopping cart

i know that when i go to browser and provide link to my
controller(product) then it calls index page then i have clicked on
new link then controller goes to new action .now i get the form to
fill my description .now when i click the create button then how it
works and how the flow goes everywhere ,how the controller calls the
different actions from here i am not getting.

when i see the source code on browser then i get/products in form
action so where it goes iam not getting so please reply me.

thanx


#2

If I understand your question correctly…

Routing seems to be the core of you are asking. In the case of the
form, when you click ‘submit’, it’s a POST action, which when combined
with your controller will be directed to the ‘create’ action. When you
first asked for the form ‘edit’ or ‘new’, then the request is
controlled by either the ‘edit’ or ‘new’ actions of of your
controller. To see the routes based on the actions do a:

rake routes


#3

Read about Routes. If you’re using Rails 2 then you shoud know
something about REST too.
And this is an excelent guide to understand routing in Rails:
http://guides.rails.info/routing/routing_outside_in.html