No routes matching

10 views
Skip to first unread message

Bob Sleys

unread,
Sep 13, 2011, 12:35:21 PM9/13/11
to hobo...@googlegroups.com
I'm creating a custom index action (select) in my projects controller per below.

class ProjectsController < ApplicationController

  hobo_model_controller

  auto_actions :all#, :except => :index
  auto_actions_for :organization, [:index, :create, :new]

  index_action :select do
    session[:project] = params[:id]
    @current_project = nil
    set_current_values
    partial "projects"
  end
  
  def show
    hobo_show do
      session[:project] = this.id
      @current_project = nil
      set_current_values
    end
  end

end

The purpose is to set a session param and return a partial back to the page. however when ever I trigger the update I get the following error

ActionController::RoutingError (No route matches "/projects/select"):

Which I'm finding quite confusing because rake routes shows the following in the list of routes

   select_projects GET    /projects/select(.:format)                              {:action=>"select", :controller=>"projects"}

Any hints on what might be going wrong here would be appreciated.

Thanks Bob


Bob Sleys

unread,
Sep 13, 2011, 1:02:31 PM9/13/11
to hobo...@googlegroups.com
It figures I spend hours on this and then 5 min after posting I finally find the problem.

For those interested I needed to add a :method => "GET" to my observe_field per below

  <%= observe_field "project", :url => {:action=>"select", :controller=>"projects"},
                    :method         => "GET",
                    :update         => "project",
                    :with           => "'id='+value" %>


Bob

Donald R. Ziesig

unread,
Sep 13, 2011, 1:24:55 PM9/13/11
to hobo...@googlegroups.com
I'm glad to see that I'm not the only one that happens to :-) .

Don z.

> --
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/owMHzO0RqXMJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

Reply all
Reply to author
Forward
0 new messages