Thank you, Fred.  You were spot on.  Explicitly designating the
controller resolved the error.

However that brought me to the next error/issue:

NoMethodError in Emailer#send_mail
Showing emailer/display.html.erb where line #71 raised:

undefined method `protect_against_forgery?' for #<ActionView::Base:
0x34d9c68>

Extracted source (around line #71):
71: <% form_for(:emailer, :url => {:controller => 'emailer', :action
=> 'send_mail'}, :html => {:class => 'style1'}) do |f| %>

RAILS_ROOT: C:/RubyRails/rails_apps/rappEAHv2
Application Trace | Framework Trace | Full Trace

C:/RubyRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_view/helpers/form_tag_helper.rb:404:in `extra_tags_for_form'
C:/RubyRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_view/helpers/form_tag_helper.rb:412:in `form_tag_html'
C:/RubyRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_view/helpers/form_tag_helper.rb:41:in `form_tag'
C:/RubyRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_view/helpers/form_helper.rb:183:in `form_for'
app/views/emailer/display.html.erb:71:in
`_run_erb_47app47views47emailer47display46html46erb'
app/controllers/emailer_controller.rb:8:in `send_mail'
-e:3:in `load'
-e:3

--------------
Googling on the error didn't turn up much and generally seemed to
attribute the problem to weirdness.  One suggestion was that the
problem's roots were due to plugin installation.  But I haven't
tinkered with the default installation plugins .  Another suggestion
was to create a new project and try again.  I did and the issue
persisted.

There were a couple of suggestions to disable or dodge
protect_against_forgery.  I was unable to do so via the controller,
but adding the following in the helper class punted the issue down the
field.

    def protect_against_forgery?
        false
    end
----------------
The punt didn't go far. This "fix" perhaps not unexpectedly resulted
in the next error: "ActionController::InvalidAuthenticityToken".

Sooo, I'm at the deep end of the pool here.  I really didn't want to
learn all about authenticity tokens at this stage of my learning
ruby.  Any further suggestions will be much appreciated as to how to
get past this error.

Thanks, Bill

On Apr 3, 3:02 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Apr 3, 3:19 am, zambezi <b.but...@overhydration.org> wrote:
>
> > I thought I would set up a simple form for email noification to tinker
> > with and see how it worked However the simplicity part has so far
> > eluded me.  Currently this particular page generates an error "Need
> > controller and action!" when to my eyes everything is in order.
>
> The clue should be in the message - you're not supplying a
> controller :-)
> Normally if you don't supply the :controller option then the current
> one is implicit, but things are different when rendering an email.
>
> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to