Topic: confused about restul routing
new to webdevelopment, rails and ruby
i'm currently learning rails from a book foundation rails 2. there is a piece of code i can't figure out:
map.lost '/lost', :controller => 'toys', :action => 'new', :type => 'LOST' map.found '/found', :controller => 'toys', :action => 'new', :type => 'FOUND'
i understand that i'm mapping /lost and /found to toys/new, but i don't understand the :type parameter. none of my models have it. my current thinking is that the request will have :type in its parameter hash, i.e. params[:type] = 'LOST' or params[:type] = 'FOUND'. if i'm correct then would it mean that i can put my own data into the params hash? i.e
map.mypath1 '/mypath1', :mycontroller => 'controller', :action => 'myaction', :mytype1 => 'somedata1', :mytype2 => 'somedata2' map.mypath2 '/mypath1', :mycontroller => 'controller', :action => 'myaction', :mytype3 => 'somedata3', :mytype4 => 'somedata4'
any help is appreciated