Here''s my case: Using a link_to popup window to show a related help file of an element on a page. The problem: Window pops up perfectly, but refuses to carryover @instance variables in the controller that I referenced in the link_to command. The tests: - I have the right controller/class, because it renders a specific template, which is what it does. - I have the right template/view, because it reflects all of the html and content--other than the variables. - I instantiated @time = Time.now in the controller-class, but @time in the view does not show up. If I simply call <%= Time.now %> -- it works, but this does explain why the controller is not sending the variables. I am stumped!?!?!? Any insightful soul with an answer???? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 15 Nov 2007, at 16:28, yachtman wrote:> > > Here''s my case: > Using a link_to popup window to show a related help file of an element > on a page. > > The problem: > Window pops up perfectly, but refuses to carryover @instance variables > in the controller that I referenced in the link_to command. > > The tests: > - I have the right controller/class, because it renders a specific > template, which is what it does. > - I have the right template/view, because it reflects all of the html > and content--other than the variables. > - I instantiated @time = Time.now in the controller-class, but @time > in the view does not show up. If I simply call <%= Time.now %> -- it > works, but this does explain why the controller is not sending the > variables.The fact that it''s a popup changes nothing: as far as rails is concerned these are 2 completetly separate requests. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Is it possible the javascript negates the variables?
Here is my code..
###
First the link in profile.rhtml
<%= link_to "?", { :action => "funny"}, :popup =>
[''Help'',
''height=600px, width=600px''] %>
###
user_controller.rb
def funny
render :layout => false
@helpy = Help.find(:first)
end
###
funny.rhtml
<p><%= @helpy.content %> should be here...</p>
###
Here is the error from the popup windo:
NoMethodError in User#funny
Showing app/views/user/funny.rhtml where line #2 raised:
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.content
Extracted source (around line #2):
1:
2: <p><%= @helpy.content %> should be here...</p>
3:
4:
5:
RAILS_ROOT: /Users/carsoncole/Desktop/gliptred/config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/views/user/funny.rhtml:2:in
`_run_rhtml_47app47views47user47funny46rhtml''
#{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/bin/mongrel_rails:16:in `load''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/bin/mongrel_rails:16
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:326:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:326:in `compile_and_render_template''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:301:in `render_template''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:260:in `render_file''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:806:in `render_file''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:777:in `render_with_no_layout''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
layout.rb:256:in `render_without_benchmark''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:50:in `render''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:50:in `render''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:1095:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:1095:in `perform_action_without_filters''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:632:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:638:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:438:in `call''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:637:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:634:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:619:in `perform_action_without_benchmark''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
rescue.rb:83:in `perform_action''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:430:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:430:in `process_without_filters''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:624:in `process_without_session_management_support''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
session_management.rb:114:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:330:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
`dispatch''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
78:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
76:in `synchronize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
76:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
`process_client''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`each''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`process_client''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`initialize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`new''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`initialize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`new''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:271:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:270:in `each''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:270:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:
211:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
#{RAILS_ROOT}/app/views/user/funny.rhtml:2:in
`_run_rhtml_47app47views47user47funny46rhtml''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:326:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:326:in `compile_and_render_template''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:301:in `render_template''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:260:in `render_file''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:806:in `render_file''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:777:in `render_with_no_layout''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
layout.rb:256:in `render_without_benchmark''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:50:in `render''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:50:in `render''
#{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:1095:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:1095:in `perform_action_without_filters''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:632:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:638:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:438:in `call''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:637:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:634:in `call_filter''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:619:in `perform_action_without_benchmark''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
rescue.rb:83:in `perform_action''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:430:in `send''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:430:in `process_without_filters''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
filters.rb:624:in `process_without_session_management_support''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
session_management.rb:114:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:330:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
`dispatch''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
78:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
76:in `synchronize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
76:in `process''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
`process_client''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`each''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`process_client''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`initialize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`new''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`initialize''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`new''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:271:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:270:in `each''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
configurator.rb:270:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in
`run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:
211:in `run''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/bin/mongrel_rails:16:in `load''
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
powerpc/bin/mongrel_rails:16
On Nov 16, 12:52 am, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On 15 Nov 2007, at 16:28, yachtman wrote:
>
>
>
>
>
> > Here''s my case:
> > Using alink_topopupwindow to show a related help file of an element
> > on a page.
>
> > The problem:
> > Window pops up perfectly, but refuses to carryover @instance variables
> > in the controller that I referenced in thelink_tocommand.
>
> > The tests:
> > - I have the right controller/class, because it renders a specific
> > template, which is what it does.
> > - I have the right template/view, because it reflects all of the html
> > and content--other than the variables.
> > - I instantiated @time = Time.now in the controller-class, but @time
> > in the view does not show up. If I simply call <%= Time.now %>
-- it
> > works, but this does explain why the controller is not sending the
> > variables.
>
> The fact that it''s apopupchanges nothing: as far as rails is
> concerned these are 2 completetly separate requests.
>
> Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Not at all. Javascript runs on the client and the client never sees ruby variables. You need to set @helpy before you render the template: def funny @helpy = Help.find(:first) render :layout => false end -Bill yachtman wrote:> Is it possible the javascript negates the variables? > > Here is my code.. > ### > First the link in profile.rhtml > <%= link_to "?", { :action => "funny"}, :popup => [''Help'', > ''height=600px, width=600px''] %> > > ### > user_controller.rb > def funny > render :layout => false > @helpy = Help.find(:first) > > end > > ### > funny.rhtml > <p><%= @helpy.content %> should be here...</p> > ### > Here is the error from the popup windo: > NoMethodError in User#funny > > Showing app/views/user/funny.rhtml where line #2 raised: > > You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.content > > Extracted source (around line #2): > > 1: > 2: <p><%= @helpy.content %> should be here...</p> > 3: > 4: > 5: > > RAILS_ROOT: /Users/carsoncole/Desktop/gliptred/config/.. > Application Trace | Framework Trace | Full Trace > > #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in > `_run_rhtml_47app47views47user47funny46rhtml'' > #{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/bin/mongrel_rails:16:in `load'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/bin/mongrel_rails:16 > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:326:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:326:in `compile_and_render_template'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:301:in `render_template'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:260:in `render_file'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:806:in `render_file'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:777:in `render_with_no_layout'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > layout.rb:256:in `render_without_benchmark'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:50:in `render'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:50:in `render'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:1095:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:1095:in `perform_action_without_filters'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:632:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:638:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:438:in `call'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:637:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:634:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:619:in `perform_action_without_benchmark'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:66:in `perform_action_without_rescue'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:66:in `perform_action_without_rescue'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > rescue.rb:83:in `perform_action'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:430:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:430:in `process_without_filters'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:624:in `process_without_session_management_support'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > session_management.rb:114:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:330:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > `dispatch'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 78:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 76:in `synchronize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 76:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in > `process_client'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > `each'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > `process_client'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `initialize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `new'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `initialize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `new'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:271:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:270:in `each'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:270:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb: > 211:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 > > #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in > `_run_rhtml_47app47views47user47funny46rhtml'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:326:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:326:in `compile_and_render_template'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:301:in `render_template'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > base.rb:260:in `render_file'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:806:in `render_file'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:777:in `render_with_no_layout'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > layout.rb:256:in `render_without_benchmark'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:50:in `render'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:50:in `render'' > #{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:1095:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:1095:in `perform_action_without_filters'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:632:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:638:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:438:in `call'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:637:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:634:in `call_filter'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:619:in `perform_action_without_benchmark'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:66:in `perform_action_without_rescue'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > benchmarking.rb:66:in `perform_action_without_rescue'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > rescue.rb:83:in `perform_action'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:430:in `send'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:430:in `process_without_filters'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > filters.rb:624:in `process_without_session_management_support'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > session_management.rb:114:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > base.rb:330:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > `dispatch'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 78:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 76:in `synchronize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > 76:in `process'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in > `process_client'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > `each'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > `process_client'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `initialize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `new'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `initialize'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `new'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:271:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:270:in `each'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:270:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in > `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb: > 211:in `run'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/bin/mongrel_rails:16:in `load'' > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > powerpc/bin/mongrel_rails:16 > > > > > > On Nov 16, 12:52 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> On 15 Nov 2007, at 16:28, yachtman wrote: >> >> >> >> >> >> >>> Here''s my case: >>> Using alink_topopupwindow to show a related help file of an element >>> on a page. >>> >>> The problem: >>> Window pops up perfectly, but refuses to carryover @instance variables >>> in the controller that I referenced in thelink_tocommand. >>> >>> The tests: >>> - I have the right controller/class, because it renders a specific >>> template, which is what it does. >>> - I have the right template/view, because it reflects all of the html >>> and content--other than the variables. >>> - I instantiated @time = Time.now in the controller-class, but @time >>> in the view does not show up. If I simply call <%= Time.now %> -- it >>> works, but this does explain why the controller is not sending the >>> variables. >>> >> The fact that it''s apopupchanges nothing: as far as rails is >> concerned these are 2 completetly separate requests. >> >> Fred >> > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
And if I replace the
@helpy = Help.find(:first) [in the controller and the following
from the view] @helpy.content
which might be a database problem, with simply
@time = Time.now ...and ... @time
The popup generates fine with no errors, but there is no output for
the variable--its blank!
On Nov 16, 11:51 am, yachtman
<carson.c...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Is it possible the javascript negates the variables?
>
> Here is my code..
> ###
> First the link in profile.rhtml
> <%=link_to"?", { :action => "funny"}, :popup=>
[''Help'',
> ''height=600px, width=600px''] %>
>
> ###
> user_controller.rb
> def funny
> render :layout => false
> @helpy = Help.find(:first)
>
> end
>
> ###
> funny.rhtml
> <p><%= @helpy.content %> should be here...</p>
> ###
> Here is the error from thepopupwindo:
> NoMethodError in User#funny
>
> Showing app/views/user/funny.rhtml where line #2 raised:
>
> You have a nil object when you didn''t expect it!
> The error occurred while evaluating nil.content
>
> Extracted source (around line #2):
>
> 1:
> 2: <p><%= @helpy.content %> should be here...</p>
> 3:
> 4:
> 5:
>
> RAILS_ROOT: /Users/carsoncole/Desktop/gliptred/config/..
> Application Trace | Framework Trace | Full Trace
>
> #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in
> `_run_rhtml_47app47views47user47funny46rhtml''
> #{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/bin/mongrel_rails:16:in `load''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/bin/mongrel_rails:16
>
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:326:in `send''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:326:in `compile_and_render_template''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:301:in `render_template''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:260:in `render_file''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:806:in `render_file''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:777:in `render_with_no_layout''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> layout.rb:256:in `render_without_benchmark''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> benchmarking.rb:50:in `render''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> benchmarking.rb:50:in `render''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:1095:in `send''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:1095:in `perform_action_without_filters''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:632:in `call_filter''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:638:in `call_filter''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:438:in `call''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:637:in `call_filter''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:634:in `call_filter''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:619:in `perform_action_without_benchmark''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> benchmarking.rb:66:in `perform_action_without_rescue''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> benchmarking.rb:66:in `perform_action_without_rescue''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> rescue.rb:83:in `perform_action''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:430:in `send''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:430:in `process_without_filters''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> filters.rb:624:in `process_without_session_management_support''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> session_management.rb:114:in `process''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:330:in `process''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
> `dispatch''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
> 78:in `process''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
> 76:in `synchronize''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:
> 76:in `process''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
> `process_client''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
> `each''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
> `process_client''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
> `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
> `initialize''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
> `new''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
> `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
> `initialize''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
> `new''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
> `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
> configurator.rb:271:in `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
> configurator.rb:270:in `each''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/
> configurator.rb:270:in `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in
> `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:
> 211:in `run''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
>
> #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in
> `_run_rhtml_47app47views47user47funny46rhtml''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:326:in `send''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:326:in `compile_and_render_template''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:301:in `render_template''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> base.rb:260:in `render_file''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:806:in `render_file''
> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/
> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> base.rb:777:in `render_with_no_layout'' ...
>
> read more >>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Bill, Thanks a kazillion! Your help is most appreciated. Totally makes sense--can''t believe that I missed the logic. Sometimes (and usually most of the time), it''s staring right at you. Finally back to some productive work. On Nov 16, 11:58 am, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote:> Not at all. Javascript runs on the client and the client never sees ruby > variables. You need to set @helpy before you render the template: > > def funny > @helpy = Help.find(:first) > render :layout => false > end > > -Bill > > yachtman wrote: > > Is it possible the javascript negates the variables? > > > Here is my code.. > > ### > > First the link in profile.rhtml > > <%= link_to "?", { :action => "funny"}, :popup => [''Help'', > > ''height=600px, width=600px''] %> > > > ### > > user_controller.rb > > def funny > > render :layout => false > > @helpy = Help.find(:first) > > > end > > > ### > > funny.rhtml > > <p><%= @helpy.content %> should be here...</p> > > ### > > Here is the error from the popup windo: > > NoMethodError in User#funny > > > Showing app/views/user/funny.rhtml where line #2 raised: > > > You have a nil object when you didn''t expect it! > > The error occurred while evaluating nil.content > > > Extracted source (around line #2): > > > 1: > > 2: <p><%= @helpy.content %> should be here...</p> > > 3: > > 4: > > 5: > > > RAILS_ROOT: /Users/carsoncole/Desktop/gliptred/config/.. > > Application Trace | Framework Trace | Full Trace > > > #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in > > `_run_rhtml_47app47views47user47funny46rhtml'' > > #{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/bin/mongrel_rails:16:in `load'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/bin/mongrel_rails:16 > > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:326:in `send'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:326:in `compile_and_render_template'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:301:in `render_template'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:260:in `render_file'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:806:in `render_file'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:777:in `render_with_no_layout'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > layout.rb:256:in `render_without_benchmark'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > benchmarking.rb:50:in `render'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > benchmarking.rb:50:in `render'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:1095:in `send'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:1095:in `perform_action_without_filters'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:632:in `call_filter'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:638:in `call_filter'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:438:in `call'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:637:in `call_filter'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:634:in `call_filter'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:619:in `perform_action_without_benchmark'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > benchmarking.rb:66:in `perform_action_without_rescue'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > benchmarking.rb:66:in `perform_action_without_rescue'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > rescue.rb:83:in `perform_action'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:430:in `send'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:430:in `process_without_filters'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > filters.rb:624:in `process_without_session_management_support'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > session_management.rb:114:in `process'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ > > base.rb:330:in `process'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > > `dispatch'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > > 78:in `process'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > > 76:in `synchronize'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: > > 76:in `process'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in > > `process_client'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > > `each'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in > > `process_client'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > > `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > > `initialize'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > > `new'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in > > `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > > `initialize'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > > `new'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in > > `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > > configurator.rb:271:in `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > > configurator.rb:270:in `each'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > > configurator.rb:270:in `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in > > `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb: > > 211:in `run'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 > > > #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in > > `_run_rhtml_47app47views47user47funny46rhtml'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:326:in `send'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:326:in `compile_and_render_template'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ > > base.rb:301:in `render_template'' > > /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ > > ... > > read more >>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
:) No problem. yachtman wrote:> Bill, > > Thanks a kazillion! Your help is most appreciated. Totally makes > sense--can''t believe that I missed the logic. Sometimes (and usually > most of the time), it''s staring right at you. > > Finally back to some productive work. > > On Nov 16, 11:58 am, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote: > >> Not at all. Javascript runs on the client and the client never sees ruby >> variables. You need to set @helpy before you render the template: >> >> def funny >> @helpy = Help.find(:first) >> render :layout => false >> end >> >> -Bill >> >> yachtman wrote: >> >>> Is it possible the javascript negates the variables? >>> >>> Here is my code.. >>> ### >>> First the link in profile.rhtml >>> <%= link_to "?", { :action => "funny"}, :popup => [''Help'', >>> ''height=600px, width=600px''] %> >>> >>> ### >>> user_controller.rb >>> def funny >>> render :layout => false >>> @helpy = Help.find(:first) >>> >>> end >>> >>> ### >>> funny.rhtml >>> <p><%= @helpy.content %> should be here...</p> >>> ### >>> Here is the error from the popup windo: >>> NoMethodError in User#funny >>> >>> Showing app/views/user/funny.rhtml where line #2 raised: >>> >>> You have a nil object when you didn''t expect it! >>> The error occurred while evaluating nil.content >>> >>> Extracted source (around line #2): >>> >>> 1: >>> 2: <p><%= @helpy.content %> should be here...</p> >>> 3: >>> 4: >>> 5: >>> >>> RAILS_ROOT: /Users/carsoncole/Desktop/gliptred/config/.. >>> Application Trace | Framework Trace | Full Trace >>> >>> #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in >>> `_run_rhtml_47app47views47user47funny46rhtml'' >>> #{RAILS_ROOT}/app/controllers/user_controller.rb:57:in `funny'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/bin/mongrel_rails:16:in `load'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/bin/mongrel_rails:16 >>> >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:326:in `send'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:326:in `compile_and_render_template'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:301:in `render_template'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:260:in `render_file'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:806:in `render_file'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:777:in `render_with_no_layout'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> layout.rb:256:in `render_without_benchmark'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> benchmarking.rb:50:in `render'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> benchmarking.rb:50:in `render'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:1095:in `send'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:1095:in `perform_action_without_filters'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:632:in `call_filter'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:638:in `call_filter'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:438:in `call'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:637:in `call_filter'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:634:in `call_filter'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:619:in `perform_action_without_benchmark'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> benchmarking.rb:66:in `perform_action_without_rescue'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/1.8/benchmark.rb:293:in `measure'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> benchmarking.rb:66:in `perform_action_without_rescue'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> rescue.rb:83:in `perform_action'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:430:in `send'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:430:in `process_without_filters'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> filters.rb:624:in `process_without_session_management_support'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> session_management.rb:114:in `process'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ >>> base.rb:330:in `process'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in >>> `dispatch'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: >>> 78:in `process'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: >>> 76:in `synchronize'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: >>> 76:in `process'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in >>> `process_client'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in >>> `each'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in >>> `process_client'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in >>> `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in >>> `initialize'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in >>> `new'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in >>> `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in >>> `initialize'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in >>> `new'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in >>> `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ >>> configurator.rb:271:in `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ >>> configurator.rb:270:in `each'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ >>> configurator.rb:270:in `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in >>> `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb: >>> 211:in `run'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 >>> >>> #{RAILS_ROOT}/app/views/user/funny.rhtml:2:in >>> `_run_rhtml_47app47views47user47funny46rhtml'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:326:in `send'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:326:in `compile_and_render_template'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/ >>> base.rb:301:in `render_template'' >>> /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/ >>> >> ... >> >> read more >> >> > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---