apotonick/apotomo — Issue #66: url_for_event - wrong number of arguments (1 for 2)
Author: banditj
Created: 2012-02-11 21:24:15+00:00
State: open

hi,

i m getting wrong number of arguments error when i try to render a widget state within a jquery ui dialog via ajax like this

```haml
%a.link(href="#") open
:javascript
$(".link").click(function() {
$.get('#{url_for_event(:list)}', function(data) {
$("#dialogEleven").html(data).dialog("open");
});
});
```

in the home#index controller

```ruby
class HomeController < ApplicationController
include Apotomo::Rails::ControllerMethods
#skip_before_filter :require_login

has_widgets do |root|
root << widget(:products)
end

def index
end
```

and the widget is

```ruby
class ProductsWidget < Apotomo::Widget
responds_to_event :list, :update_list

helper ApplicationHelper

def display(opts)
@product = VProduct.find(opts[:id]) if opts[:ptype] == "V"
return render_state :not_found if !@product
render
end

def list(opts)
@products = VProduct.get_v_products(opts[:search], opts[:page])
render
end

def update_list(opts)
@search = opts[:search]
@products = VProduct.get_v_products(opts[:search], opts[:page])
update :state => :list
end

def not_found
end

end
```

i call it in the