Def list routing

Hi!

I have made an scaffold for Item table like script/generate scaffold
Item. Everything went fine, but now i like to add list action to
controller

Def list
$items = Item.finde(:all)
end
I have added it, but how i can see the template like
http://address/items/list

Can i redirect it some how?
Action index does same thing as list action,but i want to make
different kind of view for those.

torso wrote:

Hi!

I have made an scaffold for Item table like script/generate scaffold
Item. Everything went fine, but now i like to add list action to
controller

Def list
$items = Item.finde(:all)
end
I have added it, but how i can see the template like
http://address/items/list

Can i redirect it some how?
Action index does same thing as list action,but i want to make
different kind of view for those.

I think you did not declare it in your rooting file.

Try to add/update something like that :

map.resources :items,
:collection => {
:list => :get
}

Hope this helps.

Guillaume Petit
http://www.nomadsper.com

in config/routes.rb yes

So i have to add it to the routers.rb in config directory. Am i
right?

On Jun 30, 12:42 pm, Guillaume Petit <rails-mailing-l…@andreas-

I would be more concerned with the fact he’s defining $items in his
action…

The $ signifies a global variable, which I personally have never found a
use
for. Change the $ to a @ to make it an instance variable so the variable
is
only defined for that instance.