Argument error in controller # show

I'm a beginner in rails (ruby as well)and i'm using a book to help me learn about rails (HF rails).Let's start with my spec : -i'm using radrails v.2 in aptana studio -ruby ver. 1.8.7 && ruby gems 1.3.7,with rails 2.3.4,mysql 5.1.41 and a mongrel server 1.1.5 In my controller i have the existing code :

class AdsController < ApplicationController   def show    @ad = Ad.find (params[ :id ]) end

end

my route.rb has also : ActionController::Routing::Routes.draw do |map| map.connect '/ads/:id' ,:controller=> 'ads',:action=>'show'   map.connect ':controller/:action/:id'   map.connect ':controller/:action/:id.:format' end

When i try to run the explorer i get the following error message (see attached file).I also want to add that i cant use the generate model or scaffold command properly,when i create the table command

e.g. ruby script/generate model ad name : string ,

it doesnt make a file in the migrate folder only a empty ad.rb model without any code with a comment " wrong number of arguments (1 for 2) wrong",i dont know if it is related. So i was wondering if it's a problem with aptana studio or the code from the book i used .Any usefull advice will be much appreciated.

Attachments: http://www.ruby-forum.com/attachment/5363/errorcode.txt

"e.g. ruby script/generate model ad name : string ,"

Did you put spaces between 'name' ':' and 'string'? If you did, take them out.

script/generate model ad name:string.

If you don't know about http://railstutorial.org/book then you might want to check that out.

Arailsdemo A. wrote in post #961250:

"e.g. ruby script/generate model ad name : string ,"

Did you put spaces between 'name' ':' and 'string'? If you did, take them out.

script/generate model ad name:string.

If you don't know about http://railstutorial.org/book then you might want to check that out.

Yes that part of the problem is solved(thank you!!), the spaces do the difference (although the book doesnt mention it) but the main problem is the controller error on arguement i'm recieving with the find function.The question is : is it code error or compatibility problem ?

I’m a beginner in rails (ruby as well)and i’m using a book to help me

learn about rails (HF rails).Let’s start with my spec :

-i’m using radrails v.2 in aptana studio

-ruby ver. 1.8.7 && ruby gems 1.3.7,with rails 2.3.4,mysql 5.1.41 and a

mongrel server 1.1.5

In my controller i have the existing code :

class AdsController < ApplicationController

def show

@ad = Ad.find (params[ :id ])

end

end

my route.rb has also :

ActionController::Routing::Routes.draw do |map|

map.connect ‘/ads/:id’ ,:controller=> ‘ads’,:action=>‘show’

map.connect ‘:controller/:action/:id’

map.connect ‘:controller/:action/:id.:format’

end

When i try to run the explorer i get the following error message (see

attached file).I also want to add that i cant use the generate model or

scaffold command properly,when i create the table command

e.g. ruby script/generate model ad name : string ,

To start, there should not be spaces in this command, it should be:

ruby generate model Ad name:string

If you have an empty migration file and the controller is giving you trouble, try starting over using the correct command. Also, how come you are creating just a Model and not everything for Ad up front — you can run:

ruby generate scaffold Ad name:string

And this will generate your controller, model, view templates, entries to routes, etc, etc.

i have fix the code and now i have can't find the items in my table error.QuantumDB doesnt show any data in my table although using phpadmin i can see them properly.The error says it can't convert the timestamp so i'm guessing either i must correct the jdbc connector or the ruby parameters for the timestamp.Searching for solution ...