Env:  rails 2.2.2
oracle 10g
Have created a table and sequence
--------------------------------
create table products (
id number not null,
title varchar2(100) not null,
description varchar2(255) not null,
image_url varchar2(200) not null,
price number(10,2) not null,
primary key(id)
)
create sequence products_seq
start with 1
increment by 1
nomaxvalue
No errors displaying all the products using the default action index
But when I put show/edit links , it errors out.
Is this show link is not able to get the product id ?
Please help.
route.rb is good. I did look at rake route output.
Error
------
ActionController::RoutingError in Products#index
Showing app/views/products/index.html.erb where line #17 raised:
product_url failed to generate from {:action=>"show",
:controller=>"products", :id=>#<Product id:
#<BigDecimal:506ca20,''0.1E1'',4(8)>, title:
"Laptop", description:
"Laptop - TODO", image_url:
"http://localhost:3000/products/new", price:
#<BigDecimal:506c958,''0.2E4'',4(12)>>}, expected:
{:action=>"show",
:controller=>"products"}, diff: {:id=>#<Product id:
#<BigDecimal:506c764,''0.1E1'',4(8)>, title:
"Laptop", description:
"Laptop - TODO", image_url:
"http://localhost:3000/products/new", price:
#<BigDecimal:506c69c,''0.2E4'',4(12)>>}
Extracted source (around line #17):
14:     <td><%=h product.description %></td>
15:     <td><%=h product.image_url %></td>
16:     <td><%=h product.price %></td>
17:     <td><%= link_to ''Show'', product
%></td>
18:     <td><%= link_to ''Edit'',
edit_product_path(product) %></td>
19:     <td><%= link_to ''Destroy'', product, :confirm
=> ''Are you sure?'',
:method => :delete %></td>
20:   </tr>
RAILS_ROOT: C:/Documents and Settings/beesaa/Desktop/ruby/web/depot
Application Trace | Framework Trace | Full Trace
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:377:in
`raise_named_route_error''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:341:in
`generate''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:208:in
`rewrite_path''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:187:in
`rewrite_url''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:165:in
`rewrite''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:626:in
`url_for''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:85:in
`send''
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:85:in
`url_for''
(eval):16:in `product_path''
app/views/products/index.html.erb:17
app/views/products/index.html.erb:11:in `each''
app/views/products/index.html.erb:11
app/controllers/products_controller.rb:7:in `index''
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Hi Ashok, id''s are always integer. I''m quite sure it''s the same with an Oracle DB. So please fix you database and retry. ciao, tom On Feb 11, 6:19 pm, Ashok Bee <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> create table products ( > id number not null, > ... > primary key(id) > )-- Thomas R. "TomK32" Koll <> http://ananasblau.com just a geek trying to change the world http://github.com/TomK32 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thomas r. Koll wrote:> Hi Ashok, > > id''s are always integer. I''m quite sure it''s the same with an Oracle > DB. > So please fix you database and retry. > > ciao, tom > > On Feb 11, 6:19�pm, Ashok Bee <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> create table products ( >> id number not null, >> ... >> primary key(id) >> ) > > -- > Thomas R. "TomK32" Koll <> http://ananasblau.com > just a geek trying to change the world > http://github.com/TomK32Thanks Thomas. Have corrected my table create statement. When I create a table and corresponding sequence manually, why scaffold script does not create the views with proper table fields in it? When I do C:\Documents and Settings\xyz\Desktop\ruby\web\ab>ruby script\generate scaffo ld address first_name:string last_name:string address:string phone:integer email this , it creates the views well. Do I need to give the script a hint regarding the tables fields ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
arulvel Perumal
2012-Dec-21  11:05 UTC
Re: ActionController::RoutingError in Products#index
hi all, i m also facing the same issue pls suggest me a solution????? ActionController::RoutingError in copy_books#index Showing app/views/copy_books/index.html.erb where line #32 raised: 29: <td><%=h copy_book.last_modified_by_user.username %></td> 30: <td><%=h copy_book.creation_time %></td> 31: <td><%=h copy_book.created_by_user.username %></td> 32: <td><%= link_to ''Show'', copy_book %></td> 33: <td><%= link_to ''Edit'', edit_copy_book_path(copy_book) %></td> 34: <td><%= link_to ''Destroy'', copy_book, :confirm => ''Are you sure?'', :method => :delete %></td> 35: </tr> thanks in advance.. Regards, Arul -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
wuyouduan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2012-Dec-21  11:17 UTC
Re: Re: ActionController::RoutingError in Products#index
Change Copy_book To Copy_book_path(copy_book) Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...! -----Original Message----- From: arulvel Perumal <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> Sender: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Date: Fri, 21 Dec 2012 12:05:14 To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Reply-To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: ActionController::RoutingError in Products#index hi all, i m also facing the same issue pls suggest me a solution????? ActionController::RoutingError in copy_books#index Showing app/views/copy_books/index.html.erb where line #32 raised: 29: <td><%=h copy_book.last_modified_by_user.username %></td> 30: <td><%=h copy_book.creation_time %></td> 31: <td><%=h copy_book.created_by_user.username %></td> 32: <td><%= link_to ''Show'', copy_book %></td> 33: <td><%= link_to ''Edit'', edit_copy_book_path(copy_book) %></td> 34: <td><%= link_to ''Destroy'', copy_book, :confirm => ''Are you sure?'', :method => :delete %></td> 35: </tr> thanks in advance.. Regards, Arul -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
No use ... still i m getting error :( On Wednesday, 11 February 2009 22:49:11 UTC+5:30, Ashok Bee wrote:> Env: rails 2.2.2 > oracle 10g > > Have created a table and sequence > -------------------------------- > create table products ( > id number not null, > title varchar2(100) not null, > description varchar2(255) not null, > image_url varchar2(200) not null, > price number(10,2) not null, > primary key(id) > ) > > create sequence products_seq > start with 1 > increment by 1 > nomaxvalue > > No errors displaying all the products using the default action index > But when I put show/edit links , it errors out. > Is this show link is not able to get the product id ? > Please help. > route.rb is good. I did look at rake route output. > > Error > ------ > > ActionController::RoutingError in Products#index > > Showing app/views/products/index.html.erb where line #17 raised: > > product_url failed to generate from {:action=>"show", > :controller=>"products", :id=>#<Product id: > #<BigDecimal:506ca20,''0.1E1'',4(8)>, title: "Laptop", description: > "Laptop - TODO", image_url: "http://localhost:3000/products/new", price: > #<BigDecimal:506c958,''0.2E4'',4(12)>>}, expected: {:action=>"show", > :controller=>"products"}, diff: {:id=>#<Product id: > #<BigDecimal:506c764,''0.1E1'',4(8)>, title: "Laptop", description: > "Laptop - TODO", image_url: "http://localhost:3000/products/new", price: > #<BigDecimal:506c69c,''0.2E4'',4(12)>>} > > Extracted source (around line #17): > > 14: <td><%=h product.description %></td> > 15: <td><%=h product.image_url %></td> > 16: <td><%=h product.price %></td> > 17: <td><%= link_to ''Show'', product %></td> > 18: <td><%= link_to ''Edit'', edit_product_path(product) %></td> > 19: <td><%= link_to ''Destroy'', product, :confirm => ''Are you sure?'', > :method => :delete %></td> > 20: </tr> > > RAILS_ROOT: C:/Documents and Settings/beesaa/Desktop/ruby/web/depot > Application Trace | Framework Trace | Full Trace > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:377:in > `raise_named_route_error'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:341:in > `generate'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:208:in > `rewrite_path'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:187:in > `rewrite_url'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/url_rewriter.rb:165:in > `rewrite'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:626:in > `url_for'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:85:in > `send'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/url_helper.rb:85:in > `url_for'' > (eval):16:in `product_path'' > app/views/products/index.html.erb:17 > app/views/products/index.html.erb:11:in `each'' > app/views/products/index.html.erb:11 > app/controllers/products_controller.rb:7:in `index'' > -- > Posted via http://www.ruby-forum.com/. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_9hSdNbV4I8J. For more options, visit https://groups.google.com/groups/opt_out.