can't pass parameters using redirect_to

I'm unable to pass a subset of a form's parameters to another method
within the same controller. The error message is "wrong number of
arguments (0 for 3)" and there aren't any parameters listed.

...

  def test_page(datatype, start_date, end_date)
    @actual_data = Dailytotal.actual_data_sum(datatype, start_date,
end_date)
  end
end

...

If test_page is an action, then it cannot have any parameters unless
those parameters have default values.

Either:
def test_page
  @actual_data = Dailytotal.actual_data_sum(params[:datatype],
params[:start_date], params[:end_date])
end

Or:
def test_page(datatype = params[:datatype], start_date =
params[:start_date], end_date = params[:end_date])
  @actual_data = Dailytotal.actual_data_sum(datatype, start_date,
end_date)
end

should work.

Dan Manges
http://www.dcmanges.com/blog

Uh... redirect_to does not call another action... It does an http
redirect... meaning new request... meaning no args are passed.

If you want to call another action in the same controller, just call
it... like any other method.

b

Dan Manges wrote: