NOTE:
if I dont use named routes I dont get this error for exampleif I use
<td><%= link_to ''Show'', {:controller =>
"buys", :action => "show", :id
=> buy.id} %></td>
There is no error
On Jun 10, 8:46 pm, kidpollo
<kidpo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Ok so I have this route
>
> map.namespace :trades do |trades|
> trades.resources :buys, :path_prefix =>
''/trades/:contract_id''
> end
>
> I want the contract_id variable to filter a list of buys
>
> then I try to open this routehttp://localhost:3000/trades/1/buys
>
> I get a strange error:
>
> ActionController::RoutingError in Trades/buys#index
>
> Showing trades/buys/index.html.erb where line #12 raised:
>
> trades_buy_url failed to generate from {:contract_id=>#<Trades::Buy
> id: 5951, asset_id: 309, type: "Buy", contract_id: 1,
investor_id: 1,
> date: "2001-09-30", trade_status_id: 1, is_future_operation:
false,
> quantity: #<BigDecimal:7fb8004,''0.2E2'',4(8)>,
price: #<BigDecimal:
> 7fb7fb4,''0.623E1'',8(12)>, total:
#<BigDecimal:7fb7f64,''0.1246E3'',
> 8(12)>, created_at: "2008-06-10 22:49:31", updated_at:
"2008-06-10
> 22:49:31">, :action=>"show",
:controller=>"trades/buys"}, expected:
> {:action=>"show", :controller=>"trades/buys"},
diff:
> {:contract_id=>#<Trades::Buy id: 5951, asset_id: 309, type:
"Buy",
> contract_id: 1, investor_id: 1, date: "2001-09-30",
trade_status_id:
> 1, is_future_operation: false, quantity:
#<BigDecimal:7fb6a38,''0.2E2'',
> 4(8)>, price:
#<BigDecimal:7fb69e8,''0.623E1'',8(12)>, total:
> #<BigDecimal:7fb6998,''0.1246E3'',8(12)>, created_at:
"2008-06-10
> 22:49:31", updated_at: "2008-06-10 22:49:31">}
>
> Extracted source (around line #12):
>
> 12: <td><%= link_to ''Show'', buy
%></td>
>
> Is this a bug of some sort?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---