Hi all,
I am having a problem with render function of rails. I have an
application layout which has the following code:
<%= render :partial => ''common/message'' %>
which is to render partial to display messages. I have the
_message.rhtml in the views/common folder. But when i hit the url there
is an error:
Expected kind of Outputter, got NilClass
The Application Trace is:
c:/ruby/RDE/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r/logger.rb:115:in
`add''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:30:in
`benchmark''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:58:in
`render_partial''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:756:in
`render_partial''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:680:in
`render_with_no_layout''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:253:in
`render_without_benchmark''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
`render''
c:/ruby/RDE/lib/ruby/1.8/benchmark.rb:293:in `measure''
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
`render''
#{RAILS_ROOT}/app/controllers/dbparser_controller.rb:103:in `parsesql''
What might be the problem? Please help.
Regards,
Janeve
--
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
-~----------~----~----~----~------~----~------~--~---
i don''t think you''re problem is a render problem, but a log4r
problem.
from logger.rb
# Add outputters by name or by reference. Can be done any time.
def add(*_outputters)
for thing in _outputters
o = (thing.kind_of?(Outputter) ? thing : Outputter[thing])
# some basic validation
if not o.kind_of?(Outputter)
raise TypeError, "Expected kind of Outputter, got
#{o.class}", caller
elsif o.nil?
raise TypeError, "Couldn''t find Outputter
''#{thing}''", caller
end
@outputters.push o
Logger.log_internal {"Added outputter ''#{o.name}''
to ''#{@fullname}''"}
end
@outputters
end
the first line in that method is what is causing the error.
Chris
On 8/24/06, Janeve George
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hi all,
>
> I am having a problem with render function of rails. I have an
> application layout which has the following code:
>
> <%= render :partial => ''common/message'' %>
>
> which is to render partial to display messages. I have the
> _message.rhtml in the views/common folder. But when i hit the url there
> is an error:
>
> Expected kind of Outputter, got NilClass
>
> The Application Trace is:
>
> c:/ruby/RDE/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r/logger.rb:115:in
> `add''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:30:in
> `benchmark''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:58:in
> `render_partial''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:756:in
> `render_partial''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:680:in
> `render_with_no_layout''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:253:in
> `render_without_benchmark''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
> `render''
> c:/ruby/RDE/lib/ruby/1.8/benchmark.rb:293:in `measure''
>
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
> `render''
> #{RAILS_ROOT}/app/controllers/dbparser_controller.rb:103:in
`parsesql''
>
> What might be the problem? Please help.
>
> Regards,
> Janeve
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---
Chris Hall wrote:> i don''t think you''re problem is a render problem, but a log4r problem. > > from logger.rb > > # Add outputters by name or by reference. Can be done any time. > def add(*_outputters) > for thing in _outputters > o = (thing.kind_of?(Outputter) ? thing : Outputter[thing]) > # some basic validation > if not o.kind_of?(Outputter) > raise TypeError, "Expected kind of Outputter, got #{o.class}", > caller > elsif o.nil? > raise TypeError, "Couldn''t find Outputter ''#{thing}''", caller > end > @outputters.push o > Logger.log_internal {"Added outputter ''#{o.name}'' to > ''#{@fullname}''"} > end > @outputters > end > > the first line in that method is what is causing the error. > > > ChrisThanks Chris, Is there any way i can solve this problem? I need log4r in my application. - Janeve -- 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 -~----------~----~----~----~------~----~------~--~---
i think you are out of luck... http://dev.rubyonrails.org/ticket/3512 On 8/24/06, Janeve George <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Chris Hall wrote: > > i don''t think you''re problem is a render problem, but a log4r problem. > > > > from logger.rb > > > > # Add outputters by name or by reference. Can be done any time. > > def add(*_outputters) > > for thing in _outputters > > o = (thing.kind_of?(Outputter) ? thing : Outputter[thing]) > > # some basic validation > > if not o.kind_of?(Outputter) > > raise TypeError, "Expected kind of Outputter, got #{o.class}", > > caller > > elsif o.nil? > > raise TypeError, "Couldn''t find Outputter ''#{thing}''", caller > > end > > @outputters.push o > > Logger.log_internal {"Added outputter ''#{o.name}'' to > > ''#{@fullname}''"} > > end > > @outputters > > end > > > > the first line in that method is what is causing the error. > > > > > > Chris > > Thanks Chris, > > Is there any way i can solve this problem? I need log4r in my > application. > > - Janeve > > -- > 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 -~----------~----~----~----~------~----~------~--~---