“没有路由匹配”与Rails auto_complete插件,路由定义

时间:2011-09-03 19:26:42

标签: ruby-on-rails plugins autocomplete routes

我正在使用[https://github.com/rails/auto_complete]

抱歉;它实际上是https://github.com/marklazz/auto_complete

错误:

ActionController::RoutingError in Trips#new

Showing C:/Development/DublinBusCaster/app/views/trips/_form.html.erb where line #26 raised:

No route matches {:action=>"auto_complete_for_station_full_street", :controller=>"trips"}

Extracted source (around line #26):

23:           <%= f.label "From:" %>
24:           <br/>
25:           <%= f.text_field :start_station %>
26:           <%= text_field_with_auto_complete :station, :full_street %>
27:     </div>
28: 
29: 

我的路线:

post '/trip/auto_complete_for_station_full_street' => 'trip#auto_complete_for_station_full_street'

我的控制器:

class TripsController < ApplicationController

auto_complete_for :station, :full_street

# GET /trips
# GET /trips.xml
def index

我的观点:

<div class="field">
      <%= f.label "From:" %>
      <br/>
      <%= f.text_field :start_station %>
      <%= text_field_with_auto_complete :station, :full_street %>
</div>

有什么想法吗?

0 个答案:

没有答案