CREATE TABLE dbo.bookdetails
(
id numeric(38,0) NOT NULL,
name varchar(2048) NOT NULL,
system varchar(2048) NOT NULL,
desk varchar(2048) NOT NULL,
strategy varchar(2048) NOT NULL,
trader varchar(2048) NULL
)
I scaffolded it and edited my controller as:
def list
#@bookdetail_pages, @bookdetails = paginate :bookdetails, :per_page
=> 10 @books = Bookdetail.find:all
render :xml => @books.to_xml
end
However, when I try to access this page, I get “can’t convert Hash into
String” as an error.
There is another table in the same db that i scaffold and use in exactly
the same manner and it works perfectly.
Could someone please point me what I could be doing wrong.
I think that’s because system isn’t a Rails reserved word but a Ruby on.
It’s Kernel#system. Sometimes it’s easy to forget that Rails isn’t the
only
factor in RoR. Heh.
–
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (Ruby for Rails)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)
Thanks, David, that was really helpful. And I’m up to Chapter 9 in your
book and loving it. I like your little asides in parentheses (like this)
that help clarify and refine your point. I like that thoroughness that
addresses all the little possible gotchas (at least all the ones that
you could think of).
Shauna
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.