[Nitro] Request parameters

Jon A. Lambert jlsysinc at alltel.net
Thu Jun 8 12:36:47 EDT 2006

Jonathan Buch wrote:
> George, could you please disable this "munging" of ?params=asd into
> actions?
> This really is annoying... But maybe I'm getting this all wrong?
> I know that at least Manveru has problems with that too...


I have an edit action in my controller

def edit(entry=nil)


So far so good.

This is in my edit.xhtml

<form method="post" action="edit/#{@entry.oid}">
  <textarea name="content" class="editbox">#{@entry.desc}</textarea>
  <br />
  <label for="name">Name: </label>
  <input type="text" name="name" value="#{@entry.name}" size="60" value="" 
  <br />
  <input name="commit" type="submit" value="Save" />
  <input name="commit" type="submit" value="Preview" />
  <input name="commit" type="submit" value="Cancel" />
  <input name="commit" type="submit" value="Save" />

Error: wrong number of arguments (5 for 1)

Parameters: {"name"=>nil, "commit"=>"Cancel", "content"=>nil}

REQUEST_URI => /edit/edit/2304
REFERER => http://localhost:7777/edit/2304
QUERY_STRING => edit;2304;


Why is 'edit' being loaded into the QUERY_STRING?
Is there anyway to turn off params being sent as arguments to the action?
What happens to <input type="file"> elements?
Are they on both the URI and in the params hash?

The only thing I can think of is to do:

def edit(entry=nil, *params)

Except 'edit' is loaded into the URI making my 'entry' param the 1st 
parameter on GET and 2nd parameter on POST.


J. Lambert 

More information about the Nitro-general mailing list