Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old June 28th, 2008, 04:43 AM
Newbie
 
Join Date: Oct 2007
Posts: 9
Default Ruby Reports

Hello,
I am referring the link below for creating the ruby reports.For creation of report_table, query is used for selecting only particular table.If i query the report_table, am getting error as "undefined method slice! for Hash".

Ex:
1. Author.report_table(:all, :only => ['id','name'])
If i use like this.I am getting error.
2. Author.report_table
If i use like this,its working properly.

I want to select only particular column from table.Please help me to do this.Its urgent.Thanks




http://www.oreillynet.com/pub/a/ruby/2008/04/08/ruport-business-reporting-for-ruby.html?page=1
Reply
  #2  
Old June 30th, 2008, 03:38 PM
Expert
 
Join Date: May 2007
Posts: 177
Default

I know this isn't what the tutorial says, but you could try
Code:
Author.report_table(:all, :only => 'id, name')
At least, that is how the Active Record :select seems to work.
Reply
  #3  
Old July 2nd, 2008, 02:19 PM
Newbie
 
Join Date: Oct 2007
Posts: 9
Default

Quote:
Originally Posted by improvcornartist
I know this isn't what the tutorial says, but you could try
Code:
Author.report_table(:all, :only => 'id, name')
At least, that is how the Active Record :select seems to work.

Thanks for the reply. Even that is not working for me.
We can also use Author.report_table_by_sql("select .....")
Reply
  #4  
Old July 2nd, 2008, 03:12 PM
Expert
 
Join Date: May 2007
Posts: 177
Default

It stinks when tutorials don't work the same way they tell you to do something. I'm not sure what you can do in this case. It may be best just to use Author.report_table_by_sql("select .....").
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles