hobo_index doesn't work as expected for children
Reported by Togg | June 5th, 2010 @ 09:43 PM
Calling hobo_index in a show action fails with "can't convert
String into Integer"
I repeated this on a clean hobo scaffold and its reproducable for
me.
Site:
has_many :stations, :class_name => "TestStation", :dependent
=> :destroy
TestStation:
belongs_to :site
class SitesController < ApplicationController
hobo_model_controller
auto_actions :all
def show
@selsort = parse_sort_param(:name, :ip_address) || "name"
@this = find_instance
@test_stations = @this.test_stations.apply_scopes(:search => [params[:search], :name, :ip_address],
:order_by => @selsort)
hobo_index(@test_stations, :per_page => 10)
#@test_stations = find_or_paginate(@test_stations, :per_page => 100)
end
end
Application Trace
TypeError in Sites#show
Showing app/views/sites/show.dryml where line #1 raised:
can't convert String into Integer
Extracted source (around line #1):
1:
2:
3:
4:
RAILS_ROOT: /home/xxx/testLogDb
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo.rb:95:in []'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo.rb:95:in
get_field'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo.rb:112:in
get_field_path'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo.rb:109:in
each'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo.rb:109:in
get_field_path'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:283:in
new_field_context'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:248:in
new_context'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/capture_helper.rb:129:in
with_output_buffer'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:248:in
new_context'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:273:in
new_field_context'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:324:in
_tag_context'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/taglibs/rapid_core.dryml:326:in
a'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:464:in
send'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:464:in
override_and_call_tag'
/usr/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/dryml/template_environment.rb:427:in
call_tag_parameter'
app/views/taglibs/auto/rapid/pages.dryml:596
app/views/taglibs/auto/rapid/pages.dryml:595
app/views/taglibs/auto/rapid/pages.dryml:595
app/views/taglibs/auto/rapid/pages.dryml:594
app/views/taglibs/themes/clean/clean.dryml:2:in
page_without_a4014fdf7abb'
app/views/taglibs/themes/clean/clean.dryml:1:in
page_without_a4014fdf7abb'
app/views/taglibs/front_site.dryml:10:in
page'
app/views/taglibs/front_site.dryml:9:in page'
app/views/taglibs/auto/rapid/pages.dryml:590:in
show_page__for_test_station'
app/views/taglibs/auto/rapid/pages.dryml:589:in
show_page__for_test_station'
app/views/sites/show.dryml:1:in
render_page'
app/views/sites/show.dryml:1:in `render_page'
Request
Parameters:
{"id"=>"1-zhongshan-eagle"} Show session dump
Response
Headers:
{"Content-Type"=>"", "Pragma"=>"no-cache", "Expires"=>"0", "Cache-Control"=>"no-store"}
Comments and changes to this ticket
-
Matt Jones September 14th, 2011 @ 10:43 PM
- State changed from new to invalid
- Milestone order changed from 0 to 0
hobo_index
isn't really the problem here - the trace shows something blowing up in ana
tag. In any case, you shouldn't call it in this situation (for HTML responses, it doesn't do much of anything besides call paginate; for JS responses, it will return the wrong thing).
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป