代码之家  ›  专栏  ›  技术社区  ›  Elizabeth Buckwalter

active_scaffold路由错误

  •  3
  • Elizabeth Buckwalter  · 技术社区  · 17 年前

    如果你昨天没有看到我的问题,这是我的第二个rails应用程序。第一个很顺利,但这个总是给我一个又一个随机错误。我为这个应用程序以及最后一个应用程序安装了active_scaffold(第一个错误,而不是使用script/install插件git://active_scaffold仓库,我做了脚本/安装插件 ://active_scaffold存储库。)我不想在次要模型上详细说明基本的CRUD。在安装问题之后,(在我找到http解决方案之前) 窗户 当我使用Linux时,我想试试Hobo。好吧,Hobo更新了actionmailer、actionpack、activerecord、activeresources和安装的机架。Rails甚至没有使用更新的版本。但正如您在轨迹底部看到的,它正在使用机架。我有一种感觉,这与我安装Hobo的徒劳有关,我卸载了Hobo。提前感谢。

    [编辑]
    我在 ActiveScaffold Group

    map.resources :modelName, :active_scaffold => true
    

    ActionController::部门中的路由错误#索引

    No route matches {:_method=>:get, :action=>"show_search", :controller=>"departments"}

    5:       <% next if controller.respond_to? link.security_method and !controller.send(link.security_method) -%>
    6:    <% next if link.action == 'new' && params[:nested].nil? && active_scaffold_config.list.always_show_create %>
    7:    <% next if link.action == 'show_search' && active_scaffold_config.list.always_show_search %>
    8:       <%= render_action_link(link, new_params) -%>
    9:     <% end -%>
    10: 
    11:     <%= loading_indicator_tag(:action => :table) %>
    

    模板包含跟踪:vendor/plugins/active_scaffold/frontends/default/views/list.html.erb

    Full Trace 格式化它花了很长时间。我仍然不完全熟悉SO的格式化(有时服务器会宕机。重新启动就是重新安装。这是一个播放服务器)

    3 回复  |  直到 11 年前
        1
  •  5
  •   Elizabeth Buckwalter    17 年前

    将此添加到路线:

    map.resources :modelName, :active_scaffold => true
    

    是 Github

        2
  •  1
  •   Bret Weinraub    10 年前

    至少对于Rails 4+,config/routes.rb中的条目应该如下:

    resources :models do # my model name in plural
      as_routes
      # for action links of type member, add the following
      # see also [note, via the action-link API, you can change the HTTP verb.  Adjust this route accordingly.
      # https://github.com/activescaffold/active_scaffold/wiki/Adding-custom-actions
      # get :my_custom_action, :on => :member
    end
    

    注意,要获得正确版本的Gem,需要在Gemfile中进行以下配置:

     gem 'active_scaffold', github: 'activescaffold/active_scaffold', :branch => "3-4-stable"
    

    如果你收到一个错误,即“as_routes”未找到;那将是问题所在。

    这只是4号轨道