One solution would be to make two conditional routes with the following code:
map.contact 'contact', :controller => 'messages', :action => 'new', :conditions => { :method => :get }
map.connect 'contact', :controller => 'messages', :action => 'create', :conditions => { :method => :post }
, ( ..) "" , post - "". ( : put delete, .)
, ,
<%= form_for @message do |f| %>
<%= form_for @message, :url => contact_url do |f| %>
( , .)
.
( , . .)
.
- ,
map.name_of_route JUST THE PATH. . , . , , , .
.
, ( ), . ( ), .
def map.connect_different_actions_to_same_path(path, controller, request_types_with_actions)
first = true
request_types_with_actions.each do |request, action|
route_name = first ? path : 'connect'
eval("map.#{route_name} '#{path}', :controller => '#{controller}', :action => '#{action}', :conditions => { :method => :#{request.to_s} }")
first = false
end
end
:
map.connect_different_actions_to_same_path('contact', 'messages', {:get => 'new', :post => 'create'})
, ...