Hello!

I am using the standard (scaffolded), REST routing. I need to pass
external values to my "new" action for a certain model, and let the
user complete the other fields in the standard form_for.
My initial idea has been to simply amend the URL like this:

.../foos/new?size=4&weight=2

Then in the controller I just do something like:

def new
  @temp = Foo.new
  @temp.size = params[:size]
  ...

  respond_to do |format|
      format.html
      format.xml  { render :xml => @temp }
  end

end

Thing is my form_for parameters are not picked up. Only the ones I
have setup manually in the URL (size and weight in my example) are
taken into account.
I believe it is due to the fact that they are serialized and added to
the end of the URL, whereas it already contains a "?" and some
parameters so they end up being ignored.

Do you know how to do this?

Thanks!
PJ

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to