Hello All,
I m trying to use a form on my website to send an email. So my form
goes like this :
<% form_tag("/emailfeeder/create", :method => :post) do %>
<tr>
<td class="col1">To: </td>
<td class="col2"><%= text_field_tag
"recepient",
@recepient.to_s, :disabled => true %></td>
</tr>
<tr>
<td class="col1">Your Name:</td>
<td class="col2"><%= text_field_tag :name, @name,
:class =>
"textedit" %></td>
... ... ...
And route.rb like this :
map.resources :emailfeeder
map.connect ''emailfeeder/new'', :controller =>
''emailfeeder'', :action
=> ''new''
map.connect ''emailfeeder/create'', :controller =>
''emailfeeder'', :action => ''create'',
:method => :post
I also tried :
map.with_options :controller => ''emailfeeder'' do
|emailfeeder|
emailfeeder.new ''/emailfeeder/new'', :action =>
''new'', :conditions
=> { :method => :get }
emailfeeder.create ''/emailfeeder/create'', :action =>
''create'', :conditions => { :method => :post }
end
I can t really figure out why I m still having this error :
<h1>
ActionController::MethodNotAllowed
</h1>
<pre>Only post requests are allowed.</pre>
Can someone help with this issue please.
Thanks in advance,
Regards,
Joel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---