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.
Any suggestions as to what is going on. Thanks in advance.
Bill
ERROR
ActionController::RoutingError in Emailer#send_mail
Showing emailer/display.html.erb where line #71 raised:
Need controller and action!
Extracted source (around line #71):
71: <% form_for(:emailer, :url => {:action => ‘send_mail’}, :html =>
{:class => ‘style1’}) do |f| %>
FORM
<% form_for(:emailer, :url => {:action => ‘send_mail’}, :html =>
{:class => ‘style1’}) do |f| %>
<%= label(:subject, ‘Topic:’) %>
<%= f.select :subject, %w{ Hyponatremia/hydration Admin/
site }%>
<%= label(:comment, ‘Comments:’) %>
<%= f.text_area :comment, :cols => 40, :rows => 10 %>
<%= label(:from, ‘Name:’) %>
<%= f.text_field :from, :style => “width: 200px;” %>
<%= label(:senderemail, ‘Email:’) %>
<%= f.text_field :senderemail, :style => “width: 200px;”
%>
<%= submit_tag ‘Send’ %>
CONTROLLER
class EmailerController < ApplicationController
def display
render :action => ‘display’
end
def send_mail
Emailer.deliver_display
(:subject, :comment, :senderemail, :from)
end
end