Displaying 2 results from an estimated 2 matches for "parent_model".
2006 Oct 19
1
Question about variable assignments/scoping after render call
...t how variables are made available to templates. We
have a test that looks something like this:
def test_variable_assigned
xhr :get, :do_stuff, :id => 1
assert_not_nil assigns(:thing)
end
And our app code looks like this:
class SuperClass < ActionController
def do_stuff
@parent_model = ParentModel.find(params[:id])
render :template => ''superclass/do_stuff''
end
end
class SubClass < SuperClass
def do_stuff
super
@thing = @parent_model.thing
end
end
When we run our tests with the code above, it fails saying that
assigns(:thing) i...
2008 Jul 09
1
Problem with ActiveScaffold+RecordSelect
...or in Admin/avatarsController#browse
undefined local variable or method `field'' for
#<Admin::AvatarsController:0x68aae98>
RAILS_ROOT: C:/Progetti Rails/RNetPortal
Application Trace | Framework Trace | Full Trace
Request
Parameters:
{"parent_id"=>"1",
"parent_model"=>"User"}
Show session dump
---
as:admin/avatars:
:list: {}
as:admin/users:
:list: {}
:return_to:
:user_id: 1
:csrf_id: 4d9f4ac11741e9136fc148d535879e75
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers:
{"cookie"=>[],
"Cache-Control...